# Why merge conflict block is located at the wrong place?

3 messages from 2025-03-22 to 2025-03-24. Participants: Eugen Konkov, brian m. carlson, Junio C Hamano.
Thread: https://gitlist.dev/t/63178

## Eugen Konkov, 2025-03-22 23:16

Subject: Why merge conflict block is located at the wrong place?
Message-ID: <1145598425.20250322191649@yandex.ru>
URL: https://gitlist.dev/e/1145598425.20250322191649%40yandex.ru

```
Hello Git,

I got this merge conflict:
ˋˋˋ
sub alter_field {
  my ($from_field, $to_field, $options) = @_;

  die "Can't alter field in another table"
      if ($from_field->table->name ne $to_field->table->name);

<<<<<<< HEAD
  my $generator = _generator($options);
  my @out;
||||||| parent of 1bfbcdad (Introduce and use Postgres in-database schemas)
    die "Can't alter field in another table"
        if($from_field->table->name ne $to_field->table->name);
=======
    die "Can't alter field in another table"
        if($from_field->table->qualified_name ne $to_field->table->qualified_name);
>>>>>>> 1bfbcdad (Introduce and use Postgres in-database schemas)

  # drop geometry column and constraints
  push @out, drop_geometry_column($from_field, $options), drop_geometry_constraints($from_field, $options),
      if is_geometry($from_field);
ˋˋˋ

But I expect it to be like this:
ˋˋˋ
sub alter_field {
  my ($from_field, $to_field, $options) = @_;

<<<<<<< HEAD
  die "Can't alter field in another table"
      if ($from_field->table->name ne $to_field->table->name);
||||||| parent of 1bfbcdad (Introduce and use Postgres in-database schemas)
    die "Can't alter field in another table"
        if($from_field->table->name ne $to_field->table->name);
=======
    die "Can't alter field in another table"
        if($from_field->table->qualified_name ne $to_field->table->qualified_name);
>>>>>>> 1bfbcdad (Introduce and use Postgres in-database schemas)

  my $generator = _generator($options);
  my @out;

    # drop geometry column and constraints
  push @out, drop_geometry_column($from_field, $options), drop_geometry_constraints($from_field, $options),
      if is_geometry($from_field);
ˋˋˋ

Why merge conflict block is located at the wrong place?

git version 2.49.0

-- 
Best regards,
Eugen Konkov


```

## brian m. carlson, 2025-03-23 09:08

Subject: Re: Why merge conflict block is located at the wrong place?
Message-ID: <Z9_Pkb7N1J_J9ECo@tapette.crustytoothpaste.net>
URL: https://gitlist.dev/e/Z9_Pkb7N1J_J9ECo%40tapette.crustytoothpaste.net
In-Reply-To: <1145598425.20250322191649@yandex.ru>

```
On 2025-03-22 at 23:16:49, Eugen Konkov wrote:
> Hello Git,

Hi,

> Why merge conflict block is located at the wrong place?

I think it's a little hard for us to comment on why this happens without
a reproducible testcase.  Do you perhaps have a public repository that
you're working with that you can use to demonstrate this, or a shell
script that shows the problem?
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

```

## Junio C Hamano, 2025-03-24 05:39

Subject: Re: Why merge conflict block is located at the wrong place?
Message-ID: <xmqqsen3oumi.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqsen3oumi.fsf%40gitster.g
In-Reply-To: <Z9_Pkb7N1J_J9ECo@tapette.crustytoothpaste.net>

```
"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> On 2025-03-22 at 23:16:49, Eugen Konkov wrote:
>> Hello Git,
>
> Hi,
>
>> Why merge conflict block is located at the wrong place?
>
> I think it's a little hard for us to comment on why this happens without
> a reproducible testcase.  Do you perhaps have a public repository that
> you're working with that you can use to demonstrate this, or a shell
> script that shows the problem?

We do not necessarily need a full repository, though.

It is sufficient to make the contents of the three blob objects
involved in the merge (i.e. the version in the common ancestor, and
the versions in ours and in theirs) available in order to let
anybody reproduce the symptom with "git merge-file", and that would
give us a chance to check the same input with "merge" from the RCS
suite to see if the output in question is really unreasonable or if
the expectation is skewed.



```
