RE: 'git show -c' omits hunk even though file was modified from all parents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"We do not show hunks that match one of the parents ". But in case 1 the second hunk matches one of the parents yet `git show -c` still outputs it.

diff --combined test1
index 02ef2b0,ffc05f2..59d575d
--- a/test1
+++ b/test1
@@@ -1,8 -1,8 +1,9 @@@
  One
 +Two
+ Four
  Three


  Seven
 -Ten
 +Eight
  Nine

I guess the "Furthermore, it lists only files which were modified from all parents." part explains it, but I still find the behavior to be counterintuitive.

Thanks,
Ralph

-----Original Message-----
From: Junio C Hamano <gitster@xxxxxxxxx> 
Sent: Monday, July 29, 2019 2:58 PM
To: Ralph Maalouf <ralph.maalouf@xxxxxxxxxxx>
Cc: 'git@xxxxxxxxxxxxxxx' <git@xxxxxxxxxxxxxxx>
Subject: Re: 'git show -c' omits hunk even though file was modified from all parents

So in short, one side has 1/2/3//7/10/9 in fileA and the other side has 1/4/3//7/10/9, and the result of the merge is recorded as 1/2/3//7/10/9.

> I realize that this is because fileA in the merge commit's tree is 
> identical to what it was in branchA prior to the merge (so the output 
> of 'git show -m' only outputs the diff for one parent). But I'm 
> wondering if this is the intended behavior.

Yes, that is very much intended.  We do not show hunks that match one of the parents, and if there is no hunk to show, the path itself is not shown.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux