"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: merge chokes, creates bogus conflicts
To:
Omar Polo <op@omarpolo.com>
Cc:
Christian Weisgerber <naddy@mips.inka.de>, gameoftrees@openbsd.org
Date:
Thu, 16 Feb 2023 00:21:56 +0100

Download raw body.

Thread
On Wed, Feb 15, 2023 at 06:55:18PM +0100, Omar Polo wrote:
> On 2023/02/15 16:35:44 +0100, Christian Weisgerber <naddy@mips.inka.de> wrote:
> > got merge chokes on the perl-5.36.0 commits to OpenBSD src.git and
> > creates bogus conflicts.  Here's a script to reproduce this:
> > 
> >   git clone --bare https://github.com/openbsd/src.git
> >   got co src.git
> >   cd src
> >   got br -c d122a78 local         # before perl-5.36.0 import
> >   echo dummy >README
> >   got add README
> >   got ci -m 'local: dummy commit'
> >   got up
> >   got merge master
> >   got st | grep '^[^MAD]'
> > 
> > C  gnu/usr.bin/perl/t/comp/parser.t
> 
> this one contains
> 
> : for my $marker (qw(
> : <<<<<<<
> : =======
> : >>>>>>>
> : )) {
> 
> so got considers it to be in a 'conflict' state.  Even simpler repro:
> 
> 	% cd /usr/src/gnu/usr.bin/perl/t/comp/
> 	% got status parser.t
> 	% echo >> parser.t
> 	% got status parser.t
> 	C  gnu/usr.bin/perl/t/comp/parser.t
> 
> Maybe we could manually track the conflicts during "merge" (and
> probably "rebase" too) instead of looking at the file content, but as
> things are we'll always fail to correctly handle (non-binary) files
> that contains a sequence like that.

In my opinion, this Perl script should be fixed to avoid listing conflict
markers verbatim. It is bad practice to commit such markers.