-
Notifications
You must be signed in to change notification settings - Fork 2.5k
negative refspec ^refs
not yet implemented
#6741
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
Comments
Is this issue up for grabs for a first time contributor? I took a look and I believe parsing the refspec will attempt to normalize the name Line 902 in 07c77d4
Which errors because Lines 820 to 836 in 07c77d4
I guess we'd need to update the Lines 1001 to 1009 in 07c77d4
In terms of just getting libgit2 to successfully parse the refspec, I guess this is all that we would need to change, but I'm not sure what else we'd need to update to get the rest of the library to handle negative ref specs correctly. edit (2024-11-27):
I'm likely missing some other places, but would be happy to start if this is open for contribution. |
This is 💯 open for contribution. Thanks for digging in! |
I've opened #6951 to handle being able to normalize negative refspecs, but it does not yet handle updating any of the actions that use refspecs (e.g. I wasn't quite sure what to do with the changelog as there doesn't seem to be any entries for |
I think remote fetching is the only place that makes active use of the negative refspecs. If there are other places that use it and need to be updated, please let me know and I can open up a separate PR for them. |
I think that @ryan-ph has taken care of these issues; closing this. Please open a new issue if there are additional issues that we've missed! |
I was reading through the history as I've just faced the ^refs parse issue with TortoiseGit, which is based on libgit2. I am a bit confused with the outcome. The ticked is closed, but is the issue properly resolved? I mean, the normalization will not bark anymore, but do the negative refspecs actually work when fetching from remote? If not, I believe this should be reopened... |
@skoulik this should be resolved. Have you run into the case where it is not respecting your negative refspec? |
Hi @ryan-ph |
I’ve been using this with the latest build of git-branchless and have not run into issues with it incorrectly pulling branches matched by the negative refspec. Without a reproducible bug, it’s hard to say what issue you’re running into is, especially since it’s for a tool that I do not know and cannot use. You’re more than welcome to read the attached PRs and see if there was a case that was missed. |
It seems that negative refspec in the form of
^refs
is not yet implemented in libgit2. See:Reproduction steps
Perform a fetch with a negative refspec in some application. I am using https://github.com/arxanas/git-branchless/tree/v0.8.0.
Observe the error:
The full error is specific to git-branchless, but the
not a valid refspec
part seems to come from libgit2.Expected behavior
Understand negative refspec in the form of
^refs
.Actual behavior
Do not understand negative refspec in the form of
^refs
.Version of libgit2 (release number or SHA1)
libgit2-sys 0.15.2+1.6.4
I believe this is the rust binding of libgit2 v1.6.4.
Operating system(s) tested
The text was updated successfully, but these errors were encountered: