git

package
v0.3.0-20260807201250-... Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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