Documentation
¶
Overview ¶
Package git holds the git source adapters. "git-history" scans the added lines of every commit (git log -p) and "git-staged" the added lines of the index. Both emit one chunk per file per commit (or per staged file) whose line k is line k of the file's post-image, with lines that were not added left empty, so detection reports post-image line numbers and pairs multi-part credentials within the file. They run git only through internal/gitx. Commit messages, diff text and emails never leave this package.
Index ¶
Constants ¶
const ( // History is the adapter that scans the whole history, or a range of it. History = "git-history" // Staged is the adapter that scans the staged changes. Staged = "git-staged" )
Adapter names.
Variables ¶
var ( // ErrNoPath: the spec has no repository path. ErrNoPath = errors.New("git source: no path") // ErrGitNotFound: no git binary on PATH. ErrGitNotFound = gitx.ErrNotFound // ErrNotRepo: the path is not inside a git work tree. ErrNotRepo = gitx.ErrNotRepo // ErrBadRef: the since ref is invalid or does not resolve to a commit. ErrBadRef = gitx.ErrBadRef )
Errors returned by the adapter factories, for the front door to turn into messages.
Functions ¶
func NewHistory ¶
NewHistory returns the git-history source for spec.Path, limited by spec.Since.
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is one git source.
func (*Source) History ¶
History reports whether the history walk ran and how many commits it walked. A staged source never ran a history walk.