Documentation
¶
Overview ¶
Package gitrepo is a thin wrapper over the system git binary.
Shelling out to real git is deliberate. A reimplementation (go-git and friends) would produce diffs that differ in formatting and rename detection from what the reviewer sees when they run git themselves, and linking a C library would reintroduce the runtime dependency this tool exists without. Requiring git on PATH costs nothing: without a repository there is nothing for jaira to operate on.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoGit = errors.New("gitrepo: git is not available on PATH")
ErrNoGit means the git binary is unavailable.
Functions ¶
Types ¶
type Commit ¶
type Commit struct {
SHA string `json:"sha"`
Short string `json:"short"`
Subject string `json:"subject"`
Author string `json:"author"`
Date string `json:"date"`
}
Commit describes one commit for display on a ticket.
type Repo ¶
type Repo struct{ Dir string }
Repo is a git working tree.
func (*Repo) Commits ¶
Commits resolves metadata for the SHAs recorded on a ticket. Unknown SHAs are returned with empty metadata rather than dropped, so a ticket referencing a commit from an unfetched branch still shows what it claims.
func (*Repo) Diff ¶
Diff returns the combined patch for a set of commits, scoped to those commits rather than to the working tree — a reviewer is judging what the ticket shipped, not whatever happens to be uncommitted right now.