Documentation
¶
Overview ¶
Package selfcommit is the single reusable self-commit step for auto-commit scopes. Mechanism only: auto-commit policy, git-root existence, and sync_disabled emission belong to the caller. Commit assumes a git-root and available git; it takes the commit lock, stages matchable paths, and commits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Commit ¶
Commit acquires the git-root commit lock and delegates to CommitCore. Callers that already hold the lock must call CommitCore: re-acquiring the same flock in-process blocks forever.
func CommitCore ¶
CommitCore stages matchable paths and commits under the fixed message — no push. Caller must hold the git-root commit lock. Byte-identical rewrite is a clean no-op.
func CommitPaths ¶
func CommitPaths(ctx context.Context, req BatchRequest) error
CommitPaths acquires the git-root commit lock and delegates to CommitPathsCore. Callers that already hold the lock must call CommitPathsCore.
func CommitPathsCore ¶
func CommitPathsCore(ctx context.Context, req BatchRequest) error
CommitPathsCore stages every matchable path and commits — no push. Caller must hold the git-root commit lock.
Types ¶
type BatchRequest ¶
type BatchRequest struct {
StateDir string
GitRoot string
Message string
// Paths are every touched path — new and removed. Each is staged only when matchable.
Paths []string
}
BatchRequest is a multi-file self-commit: fixed message and every touched path.
type Request ¶
type Request struct {
StateDir string
GitRoot string
Message string
// NewPath is the post-write path; always staged.
NewPath string
// OldPath is a path the mutation removed (empty for in-place rewrite).
// Staged only when matchable so a never-committed old path is omitted.
OldPath string
}
Request is one self-commit: fixed message, post-write path, and optional old path.