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 ¶
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 ¶
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.