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

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: merge chokes, creates bogus conflicts
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 15 Feb 2023 18:55:18 +0100

Download raw body.

Thread
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.