Subject: Re: understand Diff Formatting --cc flag?

From: Junio C Hamano <[email-masked]>
Date: Wed, 16 Mar 2022 12:39:03 -0700

Andy Zhang <[email-masked]> writes:

>> Among 5 parents, perhaps parent#1 and parent#2 had the same contents,
>> and parent#4 and parent#5 had the same contents, different from what
>> parent#1 and parent#3 had.  You have 3 variants (parent#1's, #3's
>> and #4's; parent#2 has the same contents as #1, parent#5 has the
>> same contents as #4).
>>
>
> [Andy wrote:] as per your comments, The 3 variants are indeed into the
> following 3 groups.
> My question is: why can #1 appear inside multiple groups? A and B.
>    <group-A> parent#1, #3, #4;
>    <group-B> parent#2, #1;
>    <group-C> parent#5, #4;

The three variants in my sample scenario were (A) used by #1, (B)
used by #3, and (C) used by #4.  #2 uses (A) and #5 uses (C).

The contents of #1 does appear twice, in #1 itself and also in #2.
That is what "#2 has the same contents as #1" means.

> [Andy wrote:] can I explain  "--cc" flag as:
> "--cc lists only either hunks which were modified from all parents, or
> hunks which were modified from at least two parents and they had
> different variants"

I do not have time to see if that matches the official explanation
found in "git diff --help", which I just re-read and I think it
gives the right definition.