threads / discuss / 30025

git's behaviour during a 'both added' merge conflict

Subject: git's behaviour during a 'both added' merge conflict

## tl;dr

2 messages between Mar 22, 2012 and Mar 22, 2012.

replies: 1people: 2as markdown or json

Jeremy Morton· Mar 22, 2012, 14:23 UTC · lore

I've noticed that when you're merging and there is a 'both added' merge conflict, git creates the .LOCAL and .REMOTE files for the merge, but not the .BASE file. Now, there isn't an actual base file because the file has been added anew in both branches, but wouldn't it make sense for git to just create an empty .BASE file anyway? Conceptually, new content is being added on both sides to an empty container - the fact that it didn't exist as a file on the filesystem before is something git isn't meant to care about. It also makes things easier for merge tools which are expecting a .BASE file; in practice, scripts just usually create the empty .BASE file anyway. Why not have git do this itself without a script?

Best regards, Jeremy Morton (Jez)

Junio C Hamano· Mar 22, 2012, 18:49 UTC · re: Jeremy Morton · lore

Re: git's behaviour during a 'both added' merge conflict

Jeremy Morton <jeremy@configit.com> writes:
> I've noticed that when you're merging and there is a 'both added'
> merge conflict, git creates the .LOCAL and .REMOTE files for the
> merge, but not the .BASE file.
Strictly speaking, git doesn't, but I think mergetool may.
You may find this thread interesting:
  http://thread.gmane.org/gmane.comp.version-control.git/188776/focus=188867

which resulted in ec245ba (mergetool: Provide an empty file when needed, 2012-01-19); that change is in v1.7.9.1 and upwards IIRC.

← back to recent threads