-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
entrymode canonicalization #1260
Conversation
@Byron it seems to reproduce the semantics of |
Alright, I will hold this PR for now while it awaits your review. Thanks for your help with this. |
Sure thing, thanks as always for the quick turnaround. FWIW a few months back when digging around this I found a bunch of neutered checks in git's mode handling (https://lore.kernel.org/all/[email protected]/T/), I believe these have since been restored but they're likely opt-in so as not to block existing non-canonical objects. I don't know if you'd already considered / found these issues (the kinda textual nature of git makes for a lot of lurking bugs and inconsistencies, it's pretty maddening, I also discovered recently that at one point git had an experimental binary loose object header patterned after pack entry headers, but that ended up being dropped). Some of the issues could occur for legacy reasons although the only one I remember was around permissions handling (a very old version of git could generate a third blob permission set1), the entry issues I'm not sure were ever generated by git but third party implementation could have run with them as git did not complain / fault. Footnotes
|
Oh that's interesting! I never saw it, and hope that was never released to avoid having to deal with this new loose object format 😅.
Generally, |
I only know of it because libgit2 has a codepath to parse them so I'd assume it did leak in the wild at one point. However the commit originally adding it is not exactly informative. Seems reasonable to ignore it I think. |
Actually, it fits my workflow better to merge this, and instead while reviewing you could create a new PR with changes should you find anything. Thanks for your understanding. |
Thanks for digging this out, very interesting indeed! And I agree, it's probably fine to just let it be forgotten and assume that no repository that uses these objects is still around. If that changes, that is somebody raises an issue with such an object as example, I'd be happy to implement it though - let's see :D. |
Sure thing. |
Fixes #1259
This means that
mode.kind()
andmode.is_*
will also work correctly if the underlying mode wasn't canonicalized, which could happen when looking at trees that were stored with very old versions of Git.