-
Notifications
You must be signed in to change notification settings - Fork 90
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
git: change Commit#String format #404
Conversation
f8fd945
to
721d447
Compare
f62b6da
to
0360540
Compare
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.
LGTM
Great job @hiddeco! 🙇
0360540
to
17a6d74
Compare
Given we are also optimizing some other bits of the Git package at present to facilitate the removal of libgit2 and address other issues. I suggest we keep this on hold until I have my proposed changes incorporating RFC-0005 for source-controller ready. |
17a6d74
to
1ac5d56
Compare
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.
LGTM
1ac5d56
to
3217c53
Compare
This changes the string format of `Commit` to use an `@` separator instead of `/`, and drops the usage of "HEAD" as a virtual named reference for commits without a named pointer (e.g. a Git branch and/or tag). Matching the (revision) format proposed in RFC-0005. Signed-off-by: Hidde Beydals <[email protected]>
Signed-off-by: Hidde Beydals <[email protected]>
Signed-off-by: Hidde Beydals <[email protected]>
This ensures the Git implementations transform any LastObservedCommit value into the new format before comparing it to what they constructed from the remote state. Signed-off-by: Hidde Beydals <[email protected]>
3217c53
to
db0daab
Compare
This ensures this strategy is backwards compatible as well, as I accidentally forgot to do this for go-git in #404. This lacks tests (as does the libgit2 implementation), and it would probably be good to make them less dynamic as a follow up, as that's how this slipped through the cracks. Signed-off-by: Hidde Beydals <[email protected]>
This ensures this strategy is backwards compatible as well, as I accidentally forgot to do this for go-git in #404. This lacks tests (as does the libgit2 implementation), and it would probably be good to make them less dynamic as a follow up, as that's how this slipped through the cracks. Signed-off-by: Hidde Beydals <[email protected]>
This changes the string format of
Commit
to use an@
separator instead of/
, and drops the usage of "HEAD" as a virtual named reference for commits without a named pointer (e.g. a Git branch and/or tag). Matching the (revision) format proposed in RFC-0005.The
LastObservedCommit
option is made backwards compatible, allowing consumers to provide a revision string in the previous format without issues.To help consumers address possible compatibility issues while working with the new (returned) format, the following functions have been added:
TransformRevision
: allows for transforming a "legacy revision" (i.e.feature/branch/5394cb7f48332b2de7c17dd8b8384bbc84b7e738
orHEAD/5394cb7f48332b2de7c17dd8b8384bbc84b7e738
) into a RFC-0005 compatible revision (i.e.feature/branch@sha1:5394cb7f48332b2de7c17dd8b8384bbc84b7e738
orsha1:5394cb7f48332b2de7c17dd8b8384bbc84b7e738
).SplitRevision
: allows for a legacy or RFC-0005 revision string to be split into a named-pointer and/or hash.ExtractNamedPointerFromRevision
: allows for extracting a named pointer from a legacy or RFC-0005 revision string.ExtractHashFromRevision
: allows for extracting a hash from a legacy or RFC-0005 revision string.