Documentation
¶
Index ¶
- func ParseConventionalCommit(message string) (ccType, scope, subject string)
- type Adapter
- func (a *Adapter) CommitExists(ref string) (bool, error)
- func (a *Adapter) CommitMessageContains(ref, marker string) (bool, error)
- func (a *Adapter) CommitRange(from, to string) ([]string, error)
- func (a *Adapter) CurrentBranch() (string, error)
- func (a *Adapter) DefaultBranch() (string, error)
- func (a *Adapter) Diff(ref string) (string, error)
- func (a *Adapter) GitDir() (string, error)
- func (a *Adapter) HeadCommit() (*domain.CommitInfo, error)
- func (a *Adapter) HeadRef() (string, error)
- func (a *Adapter) HookExists(hookType string) (bool, error)
- func (a *Adapter) InstallHook(hookType string) (domain.InstallResult, error)
- func (a *Adapter) IsInsideWorkTree() bool
- func (a *Adapter) IsMergeCommit(ref string) (bool, error)
- func (a *Adapter) IsRebaseInProgress() (bool, error)
- func (a *Adapter) LatestTag() (string, error)
- func (a *Adapter) Log(ref string) (*domain.CommitInfo, error)
- func (a *Adapter) LogAll() ([]domain.CommitInfo, error)
- func (a *Adapter) LogAllWithLimit(maxCommits int) ([]domain.CommitInfo, error)
- func (a *Adapter) UninstallHook(hookType string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseConventionalCommit ¶
ParseConventionalCommit extracts type, scope, and subject from a commit message. If the message doesn't match Conventional Commits format, type and scope are empty and subject is the full message.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements domain.GitAdapter via exec.Command("git", ...).
func NewAdapter ¶
NewAdapter is an alias for New, kept for compatibility with existing callers.
func (*Adapter) CommitMessageContains ¶
func (*Adapter) CommitRange ¶ added in v1.0.0
func (*Adapter) CurrentBranch ¶ added in v1.0.0
CurrentBranch returns the current branch name. Returns "" (no error) when HEAD is detached (rebase, CI, etc.).
func (*Adapter) DefaultBranch ¶ added in v1.1.0
DefaultBranch returns the repo's default branch name (e.g. "main", "master"). Reads from origin/HEAD. Returns "" if not determinable.
func (*Adapter) HeadCommit ¶ added in v1.0.0
func (a *Adapter) HeadCommit() (*domain.CommitInfo, error)
HeadCommit returns the full commit info for HEAD in a single git invocation, avoiding multiple exec.Command calls. It replaces separate HeadRef() + Log() calls with one `git log` invocation.
func (*Adapter) InstallHook ¶
func (a *Adapter) InstallHook(hookType string) (domain.InstallResult, error)
func (*Adapter) IsInsideWorkTree ¶
func (*Adapter) IsRebaseInProgress ¶
func (*Adapter) LogAll ¶ added in v1.0.0
func (a *Adapter) LogAll() ([]domain.CommitInfo, error)
LogAll returns all commits in the repository.
func (*Adapter) LogAllWithLimit ¶ added in v1.0.0
func (a *Adapter) LogAllWithLimit(maxCommits int) ([]domain.CommitInfo, error)
LogAllWithLimit returns up to maxCommits from git log --all. If maxCommits <= 0, all commits are returned (no limit). This method is not part of the GitAdapter interface; use it directly on *Adapter when you need bounded output (e.g. doctor rebuild).