Documentation
¶
Overview ¶
Package branches provides logic for finding and managing branches across multiple git repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MergedBranch ¶
type MergedBranch struct {
RepoPath string
RepoName string
Branch string
LastCommit time.Time
HasRemote bool
}
MergedBranch represents a branch that has been merged into the default branch.
func FindMerged ¶
func FindMerged(repos []string, workers int) ([]MergedBranch, error)
FindMerged scans the given repositories and returns branches that have been merged into each repo's default branch. The current branch and the default branch itself are excluded from results. Work is parallelized across the given number of workers.
func (MergedBranch) Label ¶
func (m MergedBranch) Label() string
Label returns a display string for the merged branch in the form "repo: branch". Branches with a remote counterpart are annotated with "(+ remote)".
type StaleBranch ¶ added in v0.2.2
type StaleBranch struct {
RepoPath string
RepoName string
Branch string
LastCommit time.Time
LastCommitMessage string
CommitsAhead int
CommitsBehind int
HasRemote bool
}
StaleBranch represents a branch that has not been committed to within the configured staleness threshold and has not been merged.
func FindStale ¶ added in v0.2.2
FindStale scans the given repositories and returns branches whose last commit is older than the given threshold. Merged branches, the default branch, and the currently checked out branch are excluded. Work is parallelized across the given number of workers.
func (StaleBranch) Label ¶ added in v0.2.2
func (s StaleBranch) Label() string
Label returns a display string for the stale branch in the form "repo: branch".