gitremote

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package gitremote finds the web address of a folder's git repository, so clients can link commits, issues and files in a reply.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lookup

func Lookup(dir string) (web, branch, root string, ok bool)

Lookup returns the web address of dir's "origin" remote (with insteadOf rewrites applied), its current branch and the repository's root folder. Any failure (not a repo, no origin, unknown host, git too slow) is ok=false. Results are cached per folder for a minute; expired entries are dropped whenever a new one is written.

func WebURL

func WebURL(remote string) (string, bool)

WebURL turns a git remote into the address of its web page, without ".git" and without credentials. An http(s) remote keeps its scheme and a non-default port (a server's web UI is where its git is); ssh, git and scp-like remotes become https on the bare host. Hosts other than GitHub and GitLab give false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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