Documentation
¶
Index ¶
- Variables
- func CheckoutBranch(branch string) (string, error)
- func CheckoutOrCreateBranch(branchName string) error
- func CheckoutOrCreateBranchInDir(dir, branchName string) error
- func Commit(message string) (string, error)
- func CreateBranch(branch string) (string, error)
- func GetCurrentBranch() (string, error)
- func GetDiff() (string, error)
- func GetLatestCommitHash() (string, error)
- func IsGitRepository() bool
- func IsGitWorktree(dir string) bool
- func VerifyBranchSnapshot(snapshots []RepoBranchSnapshot) (bool, string)
- type RepoBranchSnapshot
- type RepoInfo
- type RepoStatusSummary
Constants ¶
This section is empty.
Variables ¶
var ConfigPath = ".cyclestone/milestone.yml"
ConfigPath is the configurable path to the milestone YAML configuration.
Functions ¶
func CheckoutBranch ¶
CheckoutBranch performs a Git checkout for the specified branch.
func CheckoutOrCreateBranch ¶
CheckoutOrCreateBranch performs a checkout or creation of a branch in the root directory.
func CheckoutOrCreateBranchInDir ¶
CheckoutOrCreateBranchInDir checks out or creates a branch in a specific directory.
func CreateBranch ¶
CreateBranch creates and switches to a new Git branch.
func GetCurrentBranch ¶
GetCurrentBranch returns the name of the active Git branch.
func GetLatestCommitHash ¶
GetLatestCommitHash returns the short hash of the latest commit on the current branch.
func IsGitRepository ¶
func IsGitRepository() bool
IsGitRepository checks if the current working directory is a git repository.
func IsGitWorktree ¶
IsGitWorktree reports whether dir is the top-level directory of a git worktree.
func VerifyBranchSnapshot ¶
func VerifyBranchSnapshot(snapshots []RepoBranchSnapshot) (bool, string)
VerifyBranchSnapshot compares the current branches of all tracked repos against a saved snapshot. Returns true if matches, or false with violation descriptions.
Types ¶
type RepoBranchSnapshot ¶
type RepoBranchSnapshot struct {
Label string `json:"label"`
Path string `json:"path"`
Branch string `json:"branch"`
}
RepoBranchSnapshot represents the captured branch state of a repository.
func CaptureBranchSnapshot ¶
func CaptureBranchSnapshot() ([]RepoBranchSnapshot, error)
CaptureBranchSnapshot captures the current branch for all tracked repositories/submodules.
func CaptureBranchSnapshotForRepos ¶
func CaptureBranchSnapshotForRepos(repos []RepoInfo) ([]RepoBranchSnapshot, error)
CaptureBranchSnapshotForRepos captures the current branch for the provided repositories/submodules.
type RepoInfo ¶
RepoInfo represents a git repository worktree.
func GetTrackedRepos ¶
func GetTrackedRepos() []RepoInfo
GetTrackedRepos returns all configured, worktree-discovered, and submodule git/non-git directories.
type RepoStatusSummary ¶
type RepoStatusSummary struct {
Label string
Path string
IsWorktree bool
Branch string
Detached bool
Unknown bool
Dirty bool
ChangedCount int
StatusShort string
}
RepoStatusSummary is a read-only snapshot of one tracked repository for preflight review and other non-mutating checks.
func SummarizeRepoStatus ¶
func SummarizeRepoStatus(repo RepoInfo) RepoStatusSummary
SummarizeRepoStatus returns current branch and dirty-state information for a tracked repository without modifying branches, files, or index state.
func SummarizeTrackedRepoStatuses ¶
func SummarizeTrackedRepoStatuses() []RepoStatusSummary
SummarizeTrackedRepoStatuses summarizes all repositories returned by GetTrackedRepos. It is intentionally bounded to tracked discovery results.