Documentation
¶
Overview ¶
* Wraps access to data needed from Git. * * We invoke Git directly as a subprocess and parse the output rather than using * git2go/libgit2.
Index ¶
- func CommitsWithOpts(ctx context.Context, revs []string, pathspecs []string, filters cmd.LogFilters, ...) (iter.Seq[Commit], func() error)
- func GetRoot() (_ string, err error)
- func IsSupportedPathspec(pathspec string) bool
- func LimitDiffsByPathspec(commits iter.Seq[Commit], pathspecs []string) (iter.Seq[Commit], error)
- func ParseArgs(args []string) (revs []string, pathspecs []string, err error)
- func ParseCommits(lines iter.Seq[string]) (iter.Seq[Commit], func() error)
- func PathspecMatch(pathspec string, p string) bool
- func RevList(ctx context.Context, revranges []string, pathspecs []string, ...) (_ []string, err error)
- func SkipIgnored(commits iter.Seq[Commit], ignoreRevs []string) iter.Seq[Commit]
- func SplitPathspecs(pathspecs []string) (includes []string, excludes []string)
- func WorkingTreeFiles(pathspecs []string) (_ map[string]bool, err error)
- type Commit
- type FileDiff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitsWithOpts ¶
func CommitsWithOpts( ctx context.Context, revs []string, pathspecs []string, filters cmd.LogFilters, populateDiffs bool, configFiles config.SupplementalFiles, ) ( iter.Seq[Commit], func() error, )
Returns a single-use iterator over commits identified by the given revisions and paths.
func IsSupportedPathspec ¶
* We only support the "exclude" pathspec magic.
func LimitDiffsByPathspec ¶
func LimitDiffsByPathspec( commits iter.Seq[Commit], pathspecs []string, ) (iter.Seq[Commit], error)
Returns all commits in the input iterator, but for each commit, strips out any file diff not modifying one of the given pathspecs
func ParseArgs ¶
Handles splitting the Git revisions from the pathspecs given a list of args.
We call git rev-parse to disambiguate.
func ParseCommits ¶
Turns an iterator over lines from git log into an iterator of commits
func PathspecMatch ¶
Function might panic if passed an invalid pathspec. We validate these elsewhere.
func SkipIgnored ¶
Returns an iterator over commits that skips any revs in the given list.
func SplitPathspecs ¶
* Splits the include pathspecs from the exclude pathspecs. * * For the exclude pathspecs, we also strip off the leading "magic".