Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadGitConfig ¶
func LoadGitConfig() error
LoadGitConfig loads required git config values. Returns an error if required values are missing.
We use the git command rather than go-git's config API because go-git does not support [include] or [includeIf] directives (see https://github.com/go-git/go-git/issues/395). The git command properly handles all config levels (system, global, local) and includes.
func ResetTestConfig ¶
func ResetTestConfig()
ResetTestConfig resets the configuration to unloaded state.
func SetTestConfig ¶
func SetTestConfig(email, github string)
SetTestConfig sets test configuration values. Call ResetTestConfig after tests.
Types ¶
type BranchInfo ¶
type CommitInfo ¶
type CommitStats ¶ added in v0.1.6
type CommitStats struct {
UserTotal int `json:"user_total"`
LastUserCommit string `json:"last_user_commit,omitempty"`
LastRepoCommit string `json:"last_repo_commit,omitempty"`
}
CommitStats holds commit statistics for JSON output.
type DirtyDetails ¶
type DirtyDetails struct {
Untracked int `json:"untracked,omitempty"`
UntrackedNames []string `json:"untracked_names,omitempty"`
StagedFiles int `json:"staged,omitempty"`
StagedNames []string `json:"staged_names,omitempty"`
StagedInsertions int `json:"staged_insertions,omitempty"`
StagedDeletions int `json:"staged_deletions,omitempty"`
UnstagedFiles int `json:"unstaged,omitempty"`
UnstagedNames []string `json:"unstaged_names,omitempty"`
UnstagedInsertions int `json:"unstaged_insertions,omitempty"`
UnstagedDeletions int `json:"unstaged_deletions,omitempty"`
}
func (*DirtyDetails) String ¶
func (d *DirtyDetails) String() string
func (*DirtyDetails) TotalFiles ¶
func (d *DirtyDetails) TotalFiles() int
type RemoteInfo ¶
type RepoInfo ¶
type RepoInfo struct {
Path string `json:"path"`
Name string `json:"name"`
IsGitRepo bool `json:"is_git_repo"`
Error string `json:"error,omitempty"`
CurrentBranch string `json:"current_branch,omitempty"`
DefaultBranch string `json:"default_branch,omitempty"`
IsFork bool `json:"is_fork,omitempty"`
UpstreamURL string `json:"upstream_url,omitempty"`
Commits *CommitStats `json:"commits,omitempty"`
DirtyDetails *DirtyDetails `json:"dirty,omitempty"`
Ahead int `json:"ahead,omitempty"`
Behind int `json:"behind,omitempty"`
StashCount int `json:"stash_count,omitempty"`
Stashes []StashInfo `json:"stashes,omitempty"`
RecentCommits []CommitInfo `json:"recent_commits,omitempty"`
AllRemotes []RemoteInfo `json:"remotes,omitempty"`
BranchesWithCommits []BranchInfo `json:"branches,omitempty"`
// Internal/render-only fields excluded from JSON output:
HasUserRemote bool `json:"-"`
UserRemotes []string `json:"-"`
HasUncommittedChanges bool `json:"-"`
TotalUserCommits int `json:"-"`
LastCommitDate string `json:"-"` // Last commit by user
LastRepoCommitDate string `json:"-"` // Last commit by anyone
}
func AnalyzeDirectory ¶
func AnalyzeRepo ¶
Click to show internal directories.
Click to hide internal directories.