Documentation
¶
Index ¶
Constants ¶
const DefaultIncludeRefs = "refs/heads"
DefaultIncludeRefs is reference path that is indexed by default.
Variables ¶
ErrInvalidPositionFooter is returned when there is matching position footer key, but its value doesn't match expected format.
ErrNoPositionFooter is returned when no matching position footer is found in commit.
Functions ¶
This section is empty.
Types ¶
type CommitPosition ¶
type CommitPosition struct {
// Name is either ref name for commits created after SVN-Git
// transition, or SVN URL/branch name for commits before Git.
Name string
// Sequential number.
Number int
}
CommitPosition is extracted from Git commit message and it uniquely identifies a commit.
type GitCommit ¶
type GitCommit struct {
Repository GitRepository
Hash string
CommitMessage string
// contains filtered or unexported fields
}
GitCommit holds information about single Git commit.
func (*GitCommit) GetFooters ¶
GetFooters parses git commit message and extracts desired footers. A footer must contain key and value separated by a colon.
func (*GitCommit) GetPositionNumber ¶
func (c *GitCommit) GetPositionNumber() (*CommitPosition, error)
GetPositionNumber looks for Cr-Commit-Position or git-svn-id in commit message and returns number in that line. If there are multiple matching lines, the last instance is returned.
type GitRepository ¶
type GitRepository struct {
// Host identifies GoB host, usually only subdomain portion of
// googlesource.com. Example: chromium, pdfium
Host string
// Name is name of Git repository. Example: chromium/src
Name string
// Config is a snapshot of config.Repository. It may not be up-to-date.
Config *config.Repository
}
GitRepository uniquely identifies a repository and has reference to config, if present.
func (*GitRepository) ShouldIndex ¶
func (r *GitRepository) ShouldIndex(ref string) bool
ShouldIndex returns true if given reference should be indexed.