Thread (7 messages) flat view 7 messages, 5 authors, 2016-06-15

Re: Possible bug in Git

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:48:39


On Thu, 15 Apr 2010, Avery Pennarun wrote:
quoted
The output seems to match neither parent in any way, and yet the
simplification has resulted in no diff at all.  Strange, no?
 mkdir testy
 cd testy
 git init
 cp /etc/profile .
 git add profile
 git commit -m root
 git checkout -b a master
 cat /etc/profile >>profile
 git commit -a -m test1
 git checkout -b b master
 cat /etc/profile | tr A-Za-z a-zA-Z >profile
 git commit -a -m test1b
 git merge a
   # produces a conflict
 true >profile   # blank the file
 git commit -a -m resolved
 git show HEAD:profile
   # no output

Note that if you instead replace the file with a nonempty (but
different) file, you get something appropriate as the output.
Hmm. That does seem to be a bug. It's clearly an evil merge that doesn't 
match either side, and we should show it as such.

And yes, changing the

	true >profile

to

	echo 1 >profile

changes it to suddenly show it as such.

I guess the issue is that combine-diff decides that there is nothing in 
the result that isn't in either of the sources (because there is nothing 
at all in the result), and as such it's not "interesting" after all.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help