Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

gitserver(ListRefs): Fix type detection for lightweight tags#62671

Merged
eseliger merged 1 commit into
mainfrom
es/05-14-gitserverlistrefsfixtypedetectionforlightweighttags
May 14, 2024
Merged

gitserver(ListRefs): Fix type detection for lightweight tags#62671
eseliger merged 1 commit into
mainfrom
es/05-14-gitserverlistrefsfixtypedetectionforlightweighttags

Conversation

@eseliger

Copy link
Copy Markdown
Member

In git, there exist two types of tags: Lightweight tags, those are boring old refs that live in refs/tags/ and point directly to a commit.
And then there are annotated tags, those live in refs/tags/ too, but they don't point to a commit directly, instead they point to a tag object, which then points to a commit object.
That is used to add a message to a tag.

However, we didn't detect lightweight tags correctly, so they would be reported as Type: Branch (as they point to a commit).

This PR fixes it.

Test plan:

Added tests and verified manually using gRPC UI.

@cla-bot cla-bot Bot added the cla-signed label May 14, 2024

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @eseliger and the rest of your teammates on Graphite Graphite

@eseliger eseliger force-pushed the es/05-14-gitserverlistrefsfixtypedetectionforlightweighttags branch from 8398dd5 to 05d37e8 Compare May 14, 2024 18:11
@eseliger eseliger marked this pull request as ready for review May 14, 2024 18:27
@eseliger eseliger requested a review from a team May 14, 2024 18:27
In git, there exist two types of tags: Lightweight tags, those are boring old refs that live in refs/tags/ and point directly to a commit.
And then there are annotated tags, those live in refs/tags/ too, but they don't point to a commit directly, instead they point to a tag object, which then points to a commit object.
That is used to add a message to a tag.

However, we didn't detect lightweight tags correctly, so they would be reported as Type: Branch (as they point to a commit).

This PR fixes it.

Test plan:

Added tests and verified manually using gRPC UI.
@eseliger eseliger force-pushed the es/05-14-gitserverlistrefsfixtypedetectionforlightweighttags branch from 05d37e8 to a58775d Compare May 14, 2024 19:39
@eseliger eseliger added backport/bugfix Standard patches to fix bugs backport 5.4.0 label used to backport PRs to the 5.4.0 release branch labels May 14, 2024
@eseliger eseliger merged commit 335133a into main May 14, 2024
@eseliger eseliger deleted the es/05-14-gitserverlistrefsfixtypedetectionforlightweighttags branch May 14, 2024 19:51
sourcegraph-release-bot pushed a commit that referenced this pull request May 14, 2024
In git, there exist two types of tags: Lightweight tags, those are boring old refs that live in refs/tags/ and point directly to a commit.
And then there are annotated tags, those live in refs/tags/ too, but they don't point to a commit directly, instead they point to a tag object, which then points to a commit object.
That is used to add a message to a tag.

However, we didn't detect lightweight tags correctly, so they would be reported as Type: Branch (as they point to a commit).

This PR fixes it.

Test plan:

Added tests and verified manually using gRPC UI.

(cherry picked from commit 335133a)
Chickensoupwithrice pushed a commit that referenced this pull request May 16, 2024
…ght tags (#62674)

gitserver(ListRefs): Fix type detection for lightweight tags (#62671)

In git, there exist two types of tags: Lightweight tags, those are boring old refs that live in refs/tags/ and point directly to a commit.
And then there are annotated tags, those live in refs/tags/ too, but they don't point to a commit directly, instead they point to a tag object, which then points to a commit object.
That is used to add a message to a tag.

However, we didn't detect lightweight tags correctly, so they would be reported as Type: Branch (as they point to a commit).

This PR fixes it.

Test plan:

Added tests and verified manually using gRPC UI.

(cherry picked from commit 335133a)

Co-authored-by: Erik Seliger <erikseliger@me.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/bugfix Standard patches to fix bugs backport 5.4.0 label used to backport PRs to the 5.4.0 release branch cla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants