Skip to content
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

zero padded filemode in your git history #231

Open
tacaswell opened this issue Mar 14, 2016 · 7 comments
Open

zero padded filemode in your git history #231

tacaswell opened this issue Mar 14, 2016 · 7 comments

Comments

@tacaswell
Copy link

Trying to clone dotfiles with modern (well, fine bleeding edge) git fails:

~ 
00:39 $ git clone https://github.com/holman/dotfiles.git
Cloning into 'dotfiles'...
remote: Counting objects: 2026, done.
error: object 3aadee53f1ea498f2e496d63ac24cf28b358b9b7: zeroPaddedFilemode: contains zero-padded file modes
fatal: Error in object
fatal: index-pack failed

This seems to be due to a bug from 2005 + closing a security hole https://www.perforce.com/blog/150109/git-out-vulnerability-out-fire.

git config fetch.fsckObjects false

Will allow the repo to be cloned, but presumably there is a reason the default has been changed to true.

If you follow the directions (git fast-export --all | (cd ../myFixedRepo; git fast-import)) the issue seems to start very early in the history.

I have pushed the cleaned version here

@tacaswell
Copy link
Author

ad0452a Is the last 'good' commit in the current history.

@holman
Copy link
Owner

holman commented Mar 14, 2016

Well, fuck.

What version are you running, though? I just tried on 2.7.3 on Mac (the latest release) and had no problems cloning.

Would really hope to avoid changing the SHAs on the whole repo with a force push. :\

@holman
Copy link
Owner

holman commented Mar 14, 2016

Ah, right. Forgot about your whole comment.

› git fsck
Checking object directories: 100% (256/256), done.
warning in tree 3aadee53f1ea498f2e496d63ac24cf28b358b9b7: zeroPaddedFilemode: contains zero-padded file modes
Checking objects: 100% (2026/2026), done.

I'm guessing this would mean most people wouldn't run into this? Will need to think things over a bit to consider what the best approach is.

Open to some thoughts by those in the peanut gallery!

@tacaswell
Copy link
Author

Sorry, I confused my self, the issue was not a new version of git, it was me having

[transfer]
        fsckobjects = true
[fetch]
        fsckobjects = true
[receive]
        fsckObjects = true

in my .gitconfig on one of my machines and first tried to clone this repo just after updating git on that machine, so placed the blame in the wrong place.

So, it is a problem, but less so than I initially made it out to be.

One of your commit messages said something about tequila...

@mcornella
Copy link

According to this release of git 2.6, you should be able to ignore certain fsck errors with
git config --global fsck.<msg-id> ignore, where msg-id would be zeroPaddedFilemode in this case.

I've tried this after a user notified me of the error (ohmyzsh/ohmyzsh#4963) but the error still appears when cloning, but not when doing a git fsck. So I think there must be some kind of bug with at least git 2.8.0.rc3 which is the version I have.

Anyhow, you can try the above solution and see if it works.

@ryneeverett
Copy link

ryneeverett commented Apr 15, 2016

I've tried this after a user notified me of the error (ohmyzsh/ohmyzsh#4963) but the error still appears when cloning, but not when doing a git fsck. So I think there must be some kind of bug with at least git 2.8.0.rc3 which is the version I have.

http://thread.gmane.org/gmane.comp.version-control.git/288336

@mcornella
Copy link

Thanks! That's exactly it, it seems the setting is not implemented on fetch.fsck.*. Direct link: http://thread.gmane.org/gmane.comp.version-control.git/288336

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants