Re: [Bug?] Information around newlines lost in merge

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

 



On Tue, Jun 20, 2023 at 7:44 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
>         $ git merge-file -p A O B
>         <<<<<<< A
>         with a single line added by side A (without terminating LF).
>         \No newline at end of file
>         ||||||| O
>         =======
>         with a single line added by side B (without terminating LF).
>         \No newline at end of file
>         >>>>>>> B
>
> It has exactly the same problem we already have as these conflict
> section separator lines in that lines that exactly would look like
> these extra lines _could_ exist in the payload, so it is not
> creating a new problem, but people may have built and are happy
> enough with their incomplete automation that relies on the faulty
> assumption that the merged payload would never contain lines that
> are mistaken as conflict section separator lines, and such an
> augmented output format _will_ be a breaking change to them.
>
> So, I dunno.

Thank you for taking the time and responding. I'm wondering if there is merit
in modifying the merge algo.

Perhaps something where files merged with terminating LF would retain it.
So merging "A\n" and "B\n" would produce
"<<<<<<< master\nA=======\nB\n>>>>>>> newBranch\n\n", whereas
files being merged without a terminating LF wouldn't, so merging "A"
and "B" would
produce "<<<<<<< master\nA=======\nB\n>>>>>>> newBranch\n". Which
would make it easier to parse.

But overall, I get what you're saying. I will drop it here as expected behavior!




[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