Re: Schrödinger's diff
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Jul 7, 2009, 07:28 UTC
- Message-ID
- <4A52F90D.7080305@viscovery.net>
- In-Reply-To
- <279b37b20907062353k34bca06erf035458e80933c8d@mail.gmail.com>
Eric Raible schrieb:
Show 27 quoted lines
> Sometimes it does, and sometimes it doesn't (seems to be about > 50/50). But either way in any given repo rerunning the git-diff will > always give the same result. > > Doing an "git ls-tree HEAD" gives an identical tree in both cases. > > Can anyone explain why the output to this is not deterministic? > I'm at a complete loss. > > # Clean up from last run and start over > rm -rf .git has-crlf > git init > git config core.autocrlf false > > # Add a "bad" file > perl -e 'printf( "12%c%c", 0xd, 0xa )' > has-crlf > git add has-crlf > git commit -m"add crlf" > > # I realize that switching is ill-advised, but I'm > # trying to track down a possibly related problem... > git config core.autocrlf true > > # This sometimes produces output and sometimes it doesn't. > # Either way rerunning just git-diff always gives the same result > # as the first run in this repo. > git diff
If I put this in a script, I get a diff in 9 out of 10 runs. If I insert 'sleep 1' right before the 'git add', I never get a diff.
I'm handing this off to people who care about core.autocrlf and who know how racily-clean index entries (not) work ;)
-- Hannes