Re: Documentation bug (?) when describing `zdiff3` merge format

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

 



Am 08.08.24 um 03:22 schrieb punk.lion0906@xxxxxxxxxxxx:
> The docs at
> https://git-scm.com/docs/git-merge#_how_conflicts_are_presented
> describe the following snippets in `diff3` and `zdiff3` style as
> equivalent. They do not seem equivalent to me, so either this is a
> mistake or the `zdiff3` style is counterintuitive needs a better
> explanation.

I don't think that the documentation wants to claim any equivalence. I
can only see it says that "diff3 shows the conflict like this", and
"zdiff3 shows the conflict like that".

> zdiff3 style:
> 
> ```
> Here are lines that are either unchanged from the common
> ancestor, or cleanly resolved because only one side changed,
> or cleanly resolved because both sides changed the same way.
> <<<<<<< yours:sample.txt
> Conflict resolution is hard;
> let's go shopping.
> ||||||| base:sample.txt
> or cleanly resolved because both sides changed identically.
> Conflict resolution is hard.
> =======
> Git makes conflict resolution easy.
>>>>>>>> theirs:sample.txt
> And here is another line that is cleanly resolved or unmodified.
> ```
> 
> The problem is that, I believe, the "or cleanly resolved because both
> sides changed identically." sentence should not be part of the
> **base** in the latter example, since that whole line was moved
> outside the conflict.
This is exactly the problem that zdiff3 has: There is no way to indicate
that some line in the common ancester was resolved identically and is
now outside the conflict markers. Do not use zdiff3 if you cannot live
with this deficiency. This is in fact not made explicit in the
documentation.

-- Hannes





[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