-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect Git tags and branches that look like short commits #2795
Conversation
e1ab207
to
3c26800
Compare
3c26800
to
9c9dc57
Compare
Branch(String), | ||
/// From a tag. | ||
#[allow(unused)] | ||
Tag(String), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were removed. (See individual commits.)
/// From a reference that's ambiguously a short commit, a branch, or a tag. | ||
BranchOrTagOrCommit(String), | ||
/// From a named reference, like `refs/pull/493/head`. | ||
NamedRef(String), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was renamed from Ref
.
/// From a specific revision, using a full 40-character commit hash. | ||
FullCommit(String), | ||
/// From a truncated revision. | ||
ShortCommit(String), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now BranchOrTagOrCommit
.
9c9dc57
to
3a8bf54
Compare
3a8bf54
to
0885ee6
Compare
I'll review this tonight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me. I liked the commit breakdown. :)
Summary
If we're given a Git reference like
20240222
, we currently treat it as a short commit hash. However... it could be a branch or a tag. This PR improves the Git reference logic to ensure that ambiguous references like20240222
are handled appropriately, by attempting to extract it as a branch, then a tag, then a short commit hash.Closes #2772.