-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Fix for Bug #1321 - Support symbolic refs in tx lines for git 2.45 #1322
Conversation
12b3ad0
to
a63852a
Compare
759212e
to
85dc225
Compare
89f4ab0
to
0961aa8
Compare
22e3766
to
aa612db
Compare
Also, sorry for force-pushing and destroying all of the conversation threads. It's muscle memory :-( |
another possible issue: While this change fixes the issue for git 2.45, I think it also slows things down quite a bit for some reason. A |
Nevermind, just an issue of |
I looked into the failing If we wanted to capture the new information provided by the reference-transaction hook, we'd have to update the event log schema (as it currently stores an OID or a reference name), but not both; and even if we did all that, we'd still have all the reference-transaction hook issues as described above. The main implementation problem with removing the reference-transaction hook is that we'd have to unpack and diff against the most recent working-copy snapshot in order to restore the current undo workflow and show the list of changed references. (That code path is also effectively used in the |
Sounds like it might be better to focus on the longer-term approach, then? Since the git commit that causes the issue isn't released yet, I can just use my personal branch with the patch for now, and we can abandon this PR, if you'd like. It was a fun exercise anyway.
Is there a benefit to this, vs just sticking with the OIDs like now?
I could potentially help with this, although it's a larger-scope changed, so I'd have to get up to speed on a few more things first. |
I posted #1334 to detail the necessary work.
The main problem is that the reference-transaction hook would potentially misbehave when trying to undo/revert a symbolic reference. We treat
It will presumably be released at some point 😉. If you can add a test to expose the current failing behavior, then I'm happy to merge the PR. |
0f31af4
to
e263ddd
Compare
Ok, I've added a test and done a round of cleanup on this. |
a6aacce
to
a2af993
Compare
In git 2.45, reference transactions now support symbolic refs (see: git/git@a8ae923) To support this, we add a transaction reference resolver that's capable of looking up the Oid for a named reference. It requires a repository object to do this successfully. To support the functionality, a new `refname_to_id` function is added to the Repo object that calls the similarly named method on the inner repository to get the `git2::Oid` for a given reference name.
a2af993
to
a79800c
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.
I was able to reproduce the test failure on my end. Thanks for the fix!
When may we expect a new release containing this fix? |
In git 2.45, reference transactions now support symbolic refs (see:
git/git@a8ae923)
To support this, we add a transaction reference resolver that's capable of
looking up the Oid for a named reference. It requires a repository object to
do this successfully.
To support the functionality, a new
refname_to_id
function is added to theRepo object that calls the similarly named method on the inner repository to
get the
git2::Oid
for a given reference name.