Documentation
¶
Overview ¶
Package git parses change IDs that use the git:// URI scheme.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeID ¶
type ChangeID struct {
// Scheme captures the URI scheme (always "git" in current implementation).
Scheme string
// Remote is the host (or host:port) of the git remote the repository lives
// on (e.g. "git.example.com" or "git.example.com:9418").
Remote string
// Repo is the path to the repository on the remote and may contain slashes
// (e.g. "uber/monorepo" or "team/group/repo.git").
Repo string
// Ref is the fully-qualified git ref the change landed on, decoded from the
// URI (e.g. "refs/heads/main", "refs/tags/v1.0").
Ref string
// CommitSHA is a commit that ref has pointed to at some point in time.
CommitSHA string
}
ChangeID represents a parsed git:// change identifier. Format: git://{remote}/{repo}/{ref}/{commit_sha}
Ref is a fully-qualified, percent-encoded git ref so that branches, tags, and ref names containing slashes all fit a single path segment unambiguously.
func ParseChangeID ¶
ParseChangeID parses a raw change ID string into a ChangeID. Expected format: git://{remote}/{repo}/{ref}/{commit_sha}, where {ref} is a fully-qualified, percent-encoded git ref (e.g. "refs%2Fheads%2Fmain").
Click to show internal directories.
Click to hide internal directories.