git

package
v0.3.0-20260730171007-... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

func ParseChangeID(raw string) (ChangeID, error)

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").

func (ChangeID) String

func (c ChangeID) String() string

String returns the string representation of the change ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL