{"thread":{"id":"63178","subject":"Why merge conflict block is located at the wrong place?","startedAt":"2025-03-22T23:23:39Z","lastAt":"2025-03-24T05:39:03Z","messageCount":3,"participants":["Eugen Konkov","brian m. carlson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"514864","messageId":"1145598425.20250322191649@yandex.ru","threadId":"63178","inReplyTo":null,"subject":"Why merge conflict block is located at the wrong place?","fromName":"Eugen Konkov","fromEmail":"kes-kes@yandex.ru","sentAt":"2025-03-22T23:16:49Z","receivedAt":"2025-03-22T23:23:39Z","isPatch":false,"sender":{"key":"kes-kes@yandex.ru","avatar":null},"body":"Hello Git,\n\nI got this merge conflict:\n```\nsub alter_field {\n  my ($from_field, $to_field, $options) = @_;\n\n  die \"Can't alter field in another table\"\n      if ($from_field->table->name ne $to_field->table->name);\n\n<<<<<<< HEAD\n  my $generator = _generator($options);\n  my @out;\n||||||| parent of 1bfbcdad (Introduce and use Postgres in-database schemas)\n    die \"Can't alter field in another table\"\n        if($from_field->table->name ne $to_field->table->name);\n=======\n    die \"Can't alter field in another table\"\n        if($from_field->table->qualified_name ne $to_field->table->qualified_name);\n>>>>>>> 1bfbcdad (Introduce and use Postgres in-database schemas)\n\n  # drop geometry column and constraints\n  push @out, drop_geometry_column($from_field, $options), drop_geometry_constraints($from_field, $options),\n      if is_geometry($from_field);\n```\n\nBut I expect it to be like this:\n```\nsub alter_field {\n  my ($from_field, $to_field, $options) = @_;\n\n<<<<<<< HEAD\n  die \"Can't alter field in another table\"\n      if ($from_field->table->name ne $to_field->table->name);\n||||||| parent of 1bfbcdad (Introduce and use Postgres in-database schemas)\n    die \"Can't alter field in another table\"\n        if($from_field->table->name ne $to_field->table->name);\n=======\n    die \"Can't alter field in another table\"\n        if($from_field->table->qualified_name ne $to_field->table->qualified_name);\n>>>>>>> 1bfbcdad (Introduce and use Postgres in-database schemas)\n\n  my $generator = _generator($options);\n  my @out;\n\n    # drop geometry column and constraints\n  push @out, drop_geometry_column($from_field, $options), drop_geometry_constraints($from_field, $options),\n      if is_geometry($from_field);\n```\n\nWhy merge conflict block is located at the wrong place?\n\ngit version 2.49.0\n\n-- \nBest regards,\nEugen Konkov\n\n"},{"id":"514872","messageId":"Z9_Pkb7N1J_J9ECo@tapette.crustytoothpaste.net","threadId":"63178","inReplyTo":"1145598425.20250322191649@yandex.ru","subject":"Re: Why merge conflict block is located at the wrong place?","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2025-03-23T09:08:33Z","receivedAt":"2025-03-23T09:08:41Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2025-03-22 at 23:16:49, Eugen Konkov wrote:\n> Hello Git,\n\nHi,\n\n> Why merge conflict block is located at the wrong place?\n\nI think it's a little hard for us to comment on why this happens without\na reproducible testcase.  Do you perhaps have a public repository that\nyou're working with that you can use to demonstrate this, or a shell\nscript that shows the problem?\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"514900","messageId":"xmqqsen3oumi.fsf@gitster.g","threadId":"63178","inReplyTo":"Z9_Pkb7N1J_J9ECo@tapette.crustytoothpaste.net","subject":"Re: Why merge conflict block is located at the wrong place?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-03-24T05:39:01Z","receivedAt":"2025-03-24T05:39:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> On 2025-03-22 at 23:16:49, Eugen Konkov wrote:\n>> Hello Git,\n>\n> Hi,\n>\n>> Why merge conflict block is located at the wrong place?\n>\n> I think it's a little hard for us to comment on why this happens without\n> a reproducible testcase.  Do you perhaps have a public repository that\n> you're working with that you can use to demonstrate this, or a shell\n> script that shows the problem?\n\nWe do not necessarily need a full repository, though.\n\nIt is sufficient to make the contents of the three blob objects\ninvolved in the merge (i.e. the version in the common ancestor, and\nthe versions in ours and in theirs) available in order to let\nanybody reproduce the symptom with \"git merge-file\", and that would\ngive us a chance to check the same input with \"merge\" from the RCS\nsuite to see if the output in question is really unreasonable or if\nthe expectation is skewed.\n\n\n"}]}