taglink

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package taglink turns version bumps into verified upstream links: it fetches each source repository's tag list over git's smart-HTTP protocol (one anonymous GET per repo, no API tokens, no rate limits) and, when the old and new versions match real tags, builds compare / release-notes URLs that are guaranteed not to 404.

Index

Constants

This section is empty.

Variables

View Source
var Concurrency = 12

Concurrency is the number of repositories fetched in parallel.

View Source
var Transport = func(req *http.Request) (*http.Response, error) { return client.Do(req) }

Transport rewires requests in tests.

Functions

func Annotate

func Annotate(diffs []diffx.FileDiff)

Annotate fills CompareURL / ReleaseURL on changes whose SourceRepo is on a known forge, verifying tag names against the repository's real tag list. Best-effort and silent: unreachable repos or unmatched tags simply leave the fields empty.

func Candidates added in v0.3.4

func Candidates(c *diffx.Change, ver string) []string

Candidates lists tag names that could mark this version of a package, most likely first (exported for relnotes' no-taglink fallback, which resolves versions against a repository's release list instead of its tag advertisement).

func CompareRevsURL added in v0.5.7

func CompareRevsURL(repo, oldRev, newRev string) string

CompareRevsURL writes a forge compare link between two commit revisions verbatim — a revision addresses itself, so unlike tag links nothing needs verifying against the repository. "" when the forge is unknown.

func NormalizeRepoURL

func NormalizeRepoURL(raw string) string

NormalizeRepoURL canonicalises the many shapes registries use for a source-repo reference ("git+https://…​.git", "git@github.com:o/r.git", "git://…", trailing /tree/… paths) into a plain https URL, or "" when it can't be made canonical.

func Refs added in v0.5.0

func Refs(repo string) (tags, heads map[string]string, err error)

Refs fetches tag name -> commit SHA and branch name -> head SHA from one smart-HTTP ref advertisement. Annotated tags collapse onto their peeled (^{}) commit.

func TagSHAs added in v0.5.0

func TagSHAs(repo string) (map[string]string, error)

TagSHAs fetches tag name -> commit SHA from the same advertisement. Annotated tags collapse onto their peeled (^{}) commit.

func Tags

func Tags(repo string) (map[string]bool, error)

Tags fetches the tag names of a repository via git's smart-HTTP ref advertisement: a single anonymous GET understood by every major forge.

Types

This section is empty.

Jump to

Keyboard shortcuts

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