Subject: Re: diff-index --cc no longer permitted, gitk is now broken (slightly)

From: Sergey Organov <[email-masked]>
Date: Fri, 17 Sep 2021 20:34:12 +0300

Philip Oakley <[email-masked]> writes:

> On 17/09/2021 08:08, Sergey Organov wrote:
>> Junio C Hamano <[email-masked]> writes:
>>
>>> Sergey Organov <[email-masked]> writes:
>>>
>>>> I'm not sure I follow. What "show -p" has to do with "diff-index --cc"?
>>>>
>>>> My only point here is that usage of *--cc* in *diff-index* is entirely
>>>> undocumneted, and that needs to be somehow resolved.
>>> It was a response to your "historical status quo that is a problem."
>>> I do not think there is any problem with "diff-index --cc" (except
>>> for it wants a better documentation---but that we already agree) but
>> Ah, now I see, but it's exactly lack of documentation (and tests) that I
>> was referring to as the "problem of the historical status quo" on the
>> Git side, so I was somewhat confused by your original response.
>>
>> Also, it's still unclear, even if not very essential, what exactly that
>> "status quo" is when seen from the point of view of gitk. Does gitk
>> actually utilize *particular output* of "diff-index --cc" for better, or
>> gitk would be just as happy if it were synonym for "diff-index -p", or
>> even if it'd be just as happy if --cc were silently consumed by
>> diff-index?
>
> Did Johannes Sixt's earlier answer
> https://lore.kernel.org/git/[email-masked]/
> help clarify the choices?

Sorry, no. I did read that carefully when it has been posted. Further
explanations by Johannes also only tell that gitk expects --cc to be
accepted by diff-index as it likes to treat multiple commands
universally, but don't specify what output git expects from --cc when it
passes it exactly to diff-index. Maybe it just shows the output and have
no other expectations, dunno.

"silent fall-back from --cc to -p in case of non-merge commits or
non-conflicted index is absolutely necessary" that is stated there is a
non-issue as it was always the case, and there are no questions about
it, as --cc in fact implies -p, and the latter is applied to non-merge
commits. So, how Git treats "non-conflicted index" and non-merge commits
does not depend on --cc. It's how it treats "conflicting index" that is
still unspecified.

Thanks,
-- Sergey Organov