analyzer

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGitRepo

func IsGitRepo(path string) bool

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 BranchInfo struct {
	Name           string
	IsCurrent      bool
	CommitCount    int
	LastCommitDate string
}

type CommitInfo

type CommitInfo struct {
	Hash    string
	Message string
	Date    string
}

type DirtyDetails

type DirtyDetails struct {
	Untracked          int
	UntrackedNames     []string
	StagedFiles        int
	StagedNames        []string
	StagedInsertions   int
	StagedDeletions    int
	UnstagedFiles      int
	UnstagedNames      []string
	UnstagedInsertions int
	UnstagedDeletions  int
}

func (*DirtyDetails) String

func (d *DirtyDetails) String() string

func (*DirtyDetails) TotalFiles

func (d *DirtyDetails) TotalFiles() int

type Options

type Options struct {
	Verbose bool
}

type RemoteInfo

type RemoteInfo struct {
	Name   string
	URL    string
	IsMine bool
}

type RepoInfo

type RepoInfo struct {
	Path                  string
	Name                  string
	IsGitRepo             bool
	HasUserRemote         bool
	UserRemotes           []string
	AllRemotes            []RemoteInfo
	BranchesWithCommits   []BranchInfo
	TotalUserCommits      int
	LastCommitDate        string // Last commit by user
	LastRepoCommitDate    string // Last commit by anyone
	HasUncommittedChanges bool
	DirtyDetails          *DirtyDetails
	CurrentBranch         string
	DefaultBranch         string
	Ahead                 int
	Behind                int
	StashCount            int
	Stashes               []StashInfo
	RecentCommits         []CommitInfo // Recent commits on current branch
	IsFork                bool
	UpstreamURL           string
	Error                 string
}

func AnalyzeDirectory

func AnalyzeDirectory(path string, opts Options, showProgress bool) []RepoInfo

func AnalyzeRepo

func AnalyzeRepo(path string, opts Options) RepoInfo

type StashInfo

type StashInfo struct {
	Index   int
	Message string
	Date    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL