From ec30b342413cb35cb85560040601287cf8b12eae Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 11 Mar 2026 00:10:30 -0600 Subject: [PATCH] fix(gittag): use HEAD-{date} format for tagless repos Avoids HEAD date-versions (2024.06.08) sorting ahead of real semver tags (v1.2) since they measure different things. --- internal/classifypkg/classifypkg.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/classifypkg/classifypkg.go b/internal/classifypkg/classifypkg.go index 1a464ae..6787375 100644 --- a/internal/classifypkg/classifypkg.go +++ b/internal/classifypkg/classifypkg.go @@ -549,10 +549,10 @@ func classifyGitTag(pkg string, conf *installerconf.Conf, d *rawcache.Dir) ([]st filename = repoName + "-" + entry.GitTag } else if len(entry.Date) >= 19 { // Tagless repo (HEAD of master/main): synthesize a date-based - // version like Node.js does: "2023.10.10-18.42.21" - version = strings.ReplaceAll(entry.Date[:10], "-", ".") + - "-" + strings.ReplaceAll(entry.Date[11:19], ":", ".") - filename = repoName + "-v" + version + // version prefixed with HEAD so it doesn't sort ahead of + // real semver tags (e.g. HEAD-2023.10.10 vs v1.2). + version = "HEAD-" + strings.ReplaceAll(entry.Date[:10], "-", ".") + filename = repoName + "-" + version } else { continue }