Skip to content

feat(gitter): /tags always resolve to commit hash - #6014

Merged
Ly-Joey merged 2 commits into
google:masterfrom
Ly-Joey:gitter-tags-full-resolve
Sep 11, 2026
Merged

feat(gitter): /tags always resolve to commit hash#6014
Ly-Joey merged 2 commits into
google:masterfrom
Ly-Joey:gitter-tags-full-resolve

Conversation

@Ly-Joey

@Ly-Joey Ly-Joey commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Gitter's /tag endpoint, added in #5181, does minimal handling for annotated tags.

When tags are annotated (git tag with -a, -s, or -u), git creates a separate tag object to contain metadata (tagger, date, etc) with its own hash.
This results in annotated tags effectively resolving to two objects when we do ls-remote or show-ref

  • ref/tags/tag-name: the tag object
  • ref/tags/tag-name^{}: the peeled commit hash the tag is actually pointing to

Take https://github.com/ossf/scorecard as an example, gitter's response will contain:

{ "label": "v5.4.0", "hash": "FULSTmQUBv/amP3sUMXuB9JHJiY=" } <- Don't use this
{ "label": "v5.4.0^{}", "hash": "gO4+z+34sZq4mRcTqf2y59zXJi4=" } <- Use this

The only reason to return the tag object hash was to keep Gitter's output consistent with the git binary.
Since the tag object isn't useful downstream and might actually cause unnecessary confusion / issues, we're removing it entirely.

From now on, the resolved hash linked to a tag name will always be a commit.

@Ly-Joey
Ly-Joey enabled auto-merge (squash) September 11, 2026 03:45
@Ly-Joey
Ly-Joey merged commit 6f30c30 into google:master Sep 11, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants