forgerepo

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 3 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 forgerepo says whether two repository addresses name one repository, and whether a remote's every address names the repository the forge client resolves. It is the one comparison abcd makes of repository URLs: `abcd land` (internal/core/landing) holds its push and its pull request to it, and the sweep (internal/core/sweep) holds its deletes on origin and its forge calls to it.

A key is a URL's comparable form, so an https and an ssh address of one repository, or two spellings that differ in a user, a default port, a trailing slash, a .git suffix or case on a host, compare equal. It reads only the text it is given: it runs nothing and resolves no host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(u string) string

Key is a repository URL's comparable form, "host[:port]:/path" with the host and (on a host) the path lower-cased, any user, trailing slash and .git suffix dropped, and a port kept unless it is the scheme's own; a local path or file URL has an empty host. "" when the URL cannot be read.

func Keys

func Keys(urls ...string) map[string]bool

Keys is the set of keys of the forge's own addresses for one repository (`gh repo view --json url,sshUrl`), leaving out any that cannot be read.

func SplitKey

func SplitKey(k string) (host, path string)

SplitKey splits a Key into its host (with any port) and its path.

func Stranger

func Stranger(urls []string, keys map[string]bool) (u, key string, found bool)

Stranger is the first of a remote's addresses that does not name a repository in keys, with its key ("" when it cannot be read), and whether there is one. A remote none of whose addresses is a stranger is the forge's repository at every address it is fetched from or pushed to.

Types

This section is empty.

Jump to

Keyboard shortcuts

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