Documentation
¶
Index ¶
- func Checkout(ctx context.Context, repoPath, branch string, create bool) error
- func DefaultParallelism() int
- func Log(ctx context.Context, repoPath string, max int) (string, error)
- func ScanGitRepos(ctx context.Context, rootDir string) ([]string, error)
- type BatchOptions
- type BranchInfo
- type CloneResult
- type CloneSpec
- type DiffFile
- type FileDiff
- type OperationResult
- func Fetch(ctx context.Context, name, repoPath string) *OperationResult
- func FetchAll(ctx context.Context, rootDir string, repos map[string]string, parallel int) []*OperationResult
- func FetchAllWithOptions(ctx context.Context, rootDir string, repos map[string]string, ...) []*OperationResult
- func Pull(ctx context.Context, name, repoPath string) *OperationResult
- func PullAll(ctx context.Context, rootDir string, repos map[string]string, parallel int) []*OperationResult
- func PullAllWithOptions(ctx context.Context, rootDir string, repos map[string]string, ...) []*OperationResult
- type RemoteBranchInfo
- type RepoInfo
- type RepoStatus
- type WorktreeStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultParallelism ¶ added in v0.0.4
func DefaultParallelism() int
DefaultParallelism keeps network fan-out bounded even on high-core machines.
Types ¶
type BatchOptions ¶ added in v0.0.4
type BatchOptions struct {
Parallel int
Timeout time.Duration
OnProgress func(completed, total int, result *OperationResult)
}
BatchOptions controls bounded parallel network operations across repositories.
type BranchInfo ¶
type BranchInfo struct {
Name string // branch name, e.g. "main", "feature/foo"
Current bool // true if HEAD points to this branch
Remote string // upstream short ref, e.g. "origin/main", empty if no upstream
Ahead int // commits ahead of upstream
Behind int // commits behind upstream
}
BranchInfo holds metadata about a single local branch.
func GetBranches ¶
func GetBranches(ctx context.Context, repoPath string) ([]BranchInfo, error)
GetBranches returns all local branches for a repo with upstream tracking info. The current branch is always first.
type CloneResult ¶
CloneResult holds the outcome of a single clone operation.
type CloneSpec ¶
type CloneSpec struct {
Path string
Remote string
Branch string
Depth int // 0 = full clone, >0 = shallow clone
}
CloneSpec describes a repo to clone.
type OperationResult ¶
OperationResult holds the outcome of a single pull or fetch operation.
func FetchAllWithOptions ¶ added in v0.0.4
func FetchAllWithOptions(ctx context.Context, rootDir string, repos map[string]string, opts BatchOptions) []*OperationResult
func PullAllWithOptions ¶ added in v0.0.4
func PullAllWithOptions(ctx context.Context, rootDir string, repos map[string]string, opts BatchOptions) []*OperationResult
type RemoteBranchInfo ¶
type RemoteBranchInfo struct {
Name string // e.g. "origin/main"
}
RemoteBranchInfo holds metadata about a remote-tracking branch.
func GetRemoteBranches ¶
func GetRemoteBranches(ctx context.Context, repoPath string) ([]RemoteBranchInfo, error)
GetRemoteBranches returns all remote-tracking branches for a repo.
type RepoStatus ¶
type RepoStatus struct {
Name string
Path string
Branch string
Remote string
Ahead int
Behind int
Worktree WorktreeStatus
Error error
}
func GetStatuses ¶
func (*RepoStatus) IsClean ¶
func (s *RepoStatus) IsClean() bool
func (*RepoStatus) StatusString ¶
func (s *RepoStatus) StatusString() string
type WorktreeStatus ¶
type WorktreeStatus int
const ( StatusClean WorktreeStatus = iota StatusDirty StatusStaged StatusUntracked StatusConflicted StatusMissing )
Click to show internal directories.
Click to hide internal directories.