Re: Possible bug in Git
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Apr 16, 2010, 15:53 UTC
- Message-ID
- <alpine.LFD.2.00.1004160845350.15116@i5.linux-foundation.org>
- In-Reply-To
- <k2n32541b131004151713s51498b01s34c5a95c0f360901@mail.gmail.com>
On Thu, 15 Apr 2010, Avery Pennarun wrote:
Show 25 quoted lines
> > > > 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