git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [QUESTION] Git fails to detect merge conflict?

From
AEAnton Ermolenko <aermolenko@atlassian.com>
Date
Jul 5, 2019, 00:45 UTC
Message-ID
<70A38295-66D4-43B0-87EF-EA3EB5C0CEAE@atlassian.com>
In-Reply-To
<20190702001528.GA94153@google.com>
Hello!
Thanks for you answer.
The original content of the file:
--- START ---
  LINE 1
  LINE 2
  LINE 3
---  END  —
Branch “change-a” modifies it to become:
--- START ---
  LINE 1
  LINE 2
  LINE 3
  LINE 4
  LINE 5
  LINE 6
  LINE 7
  LINE 8
  LINE 9
---  END  —
While branch “change-b” modifies it to become:
--- START ---
  LINE 1
  LINE B
  LINE 3
  LINE D
  LINE E
  LINE 3
---  END  —

Now, on master I’m able to perform “—no-ff” merge with and git does not detect any conflict. The result is this:

--- START ---
  LINE 1
  LINE B
  LINE 3
  LINE D
  LINE E
  LINE 3
  LINE 4
  LINE 5
  LINE 6
  LINE 7
  LINE 8
  LINE 9
---  END  —
Which is both changes applied sequentially - first, the change from “change-b” as it happens to be earlier in the file, then change from “change-a”.

Thank you, Anton.

Show 16 quoted lines
> On 2 Jul 2019, at 10:15 am, Jonathan Nieder <jrnieder@gmail.com> wrote:
> 
> Anton Ermolenko wrote:
> 
>> My understanding is that recursive merge here won't consider that situation to
>> be a merge conflict as the changes have been introduced in different spots in
>> the file.
> 
> Yes, that seems right to me.
> 
> Do you have more details about the context?  What do these files look
> like?  Are there other cues that we could use to discover that the
> customer intended the changes to conflict?
> 
> Thanks,
> Jonathan
Previous: Jonathan Nieder
Message 3 of 3 in “[QUESTION] Git fails to detect merge conflict?”
  1. Anton ErmolenkoJul 1, 2019
  2. Jonathan NiederJul 2, 2019
  3. Anton ErmolenkoJul 5, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.