gitremote

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: AGPL-3.0 Imports: 8 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 gitremote canonicalizes a git origin URL into akari's project key: a stable "authority/owner/.../repo" string that is identical across machines, clone URLs (ssh, https, scp-like), and worktrees. Keying projects by this canonical remote (not the local directory) is what collapses every checkout of a repo into one project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSSHAliases

func LoadSSHAliases() map[string]string

LoadSSHAliases reads ~/.ssh/config and returns a map of Host alias to its resolved HostName. Missing or unreadable config yields an empty map; alias resolution is purely best effort.

Types

type Remote

type Remote struct {
	Key   string // authority/owner/.../repo, the canonical project key
	Host  string // host authority, with IPv6 addresses bracketed
	Owner string // everything between host and repo (may contain slashes)
	Repo  string // final path segment
}

Remote is a canonicalized origin URL.

func Canonicalize

func Canonicalize(raw string, aliases map[string]string) (Remote, error)

Canonicalize turns an origin URL into a canonical project key. aliases maps an ssh Host alias to its real HostName (from LoadSSHAliases); pass nil to skip alias resolution. Alias resolution is best effort: an unresolved alias is left as-is, which at worst yields a duplicate project rather than a wrong merge.

Jump to

Keyboard shortcuts

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