gitref

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 12 Imported by: 0 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 gitref holds the git helpers of the git-push transport (spec 8.4): clone URL derivation, known hosts, and job-ref sweeping. It imports nothing from bitc.

Index

Constants

View Source
const AgentRefPrefix = "refs/bitc/agent/"

AgentRefPrefix holds the hidden refs that carry a source = "build" agent commit (spec 8.4).

Variables

This section is empty.

Functions

func CloneURL

func CloneURL(remoteURL string) (string, error)

CloneURL derives the SSH clone URL from a remote URL; userinfo is never sent.

func DeleteRefDetached

func DeleteRefDetached(wt, remoteName, ref string)

DeleteRefDetached hands a ref deletion to a new session so an interrupted caller never waits for the network (spec 8.3 cleanup order).

func FirstLine

func FirstLine(s string) string

FirstLine is the first line of s, trimmed.

func HostOf

func HostOf(clone string) string

HostOf returns the host of an SSH clone URL.

func KnownHostsHas

func KnownHostsHas(kh, host string) bool

KnownHostsHas reports whether an OpenSSH known_hosts text has a key for host.

func RedactURL

func RedactURL(s string) string

RedactURL drops userinfo from any URL in a message (git can echo the remote URL).

func RepoID

func RepoID(clone string) string

RepoID is 16 hex of sha256 of the clone URL.

func SweepRefs

func SweepRefs(ctx context.Context, wt, remoteName, prefix, install string, olderThan time.Duration, dry bool) ([]string, error)

SweepRefs deletes own refs (this install) older than olderThan (spec 8.3 leak control).

Types

This section is empty.

Jump to

Keyboard shortcuts

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