git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Schrödinger's diff
@ 2009-07-07  6:53 Eric Raible
  2009-07-07  7:28 ` Johannes Sixt
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Eric Raible @ 2009-07-07  6:53 UTC (permalink / raw)
  To: Git Mailing List

git version 1.6.3.2.1299.gee46c (msysgit)

In trying to track down some annoying crlf corruption in a repo
I have found a Schrödinger's diff.  In other words it's unknown
whether the diff will produce output or not on any particular run
of the following script.

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

- Eric

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-07-08  6:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-07  6:53 Schrödinger's diff Eric Raible
2009-07-07  7:28 ` Johannes Sixt
2009-07-07  7:52 ` Andreas Ericsson
2009-07-07 17:36 ` Daniel Barkalow
2009-07-07 19:36   ` Jeff King
2009-07-07 19:48     ` Junio C Hamano
2009-07-07 19:54       ` Jeff King
2009-07-07 22:22         ` Junio C Hamano
2009-07-08  0:17           ` Eric Raible
2009-07-08  2:54             ` Junio C Hamano
2009-07-08  6:13               ` Eric Raible
2009-07-07 20:30       ` Eric Raible
2009-07-07 20:48         ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).