Subject: Re: [PATCH v3] mergetool: Provide an empty file when needed

From: Junio C Hamano <[email-masked]>
Date: Fri, 20 Jan 2012 10:28:25 -0800

Jason Wenger <[email-masked]> writes:

> On Fri, Jan 20, 2012 at 01:53, David Aguilar <[email-masked]> wrote:
>> On Thu, Jan 19, 2012 at 11:47 PM, David Aguilar <[email-masked]> wrote:
>>> Some merge tools cannot cope when $LOCAL, $BASE, or $REMOTE
>>> are missing.  $BASE can be missing when two branches
>>> independently add the same filename.  $LOCAL and $REMOTE
>>> can be missing when a delete/modify conflict occurs.
>>>
>>> Provide an empty file to make these tools happy.
>
> This is cleaner, yes -- but is this extra processing on $LOCAL and
> $REMOTE necessary?  Git mergetool doesn't actually call an external
> mergetool during del/mod conflicts -- instead it goes into an
> alternate processing and prompts the user interactively whether to
> take the deleted or modified file.  Can these changes be reached?
> (command line option I'm not aware of?)

Thanks for a careful reading. I did not read outside the context of the
patch so I didn't know if we had special cases for del/mod.

A bigger question is if the del/mod codepaths are negatively affected by
the presense of these superfluous empty $LOCAL/$REMOTE files. If they are,
this change will _break_ things. If they are not, I think the change would
be OK.

Another small worry is that this could potentially negatively affect some
merge tools that are sufficiently clueful, if it can give different and
better results for a true two-way-merge than a simulated two-way-merge
this patch feeds them by using a three-way-merge with an empty file as a
base.