Subject: Re: [PATCH 2/2] p4merge: create a virtual base if none available

From: Kevin Bracey <[email-masked]>
Date: Thu, 07 Mar 2013 08:28:00 +0200

On 07/03/2013 04:23, David Aguilar wrote:
> On Wed, Mar 6, 2013 at 12:32 PM, Kevin Bracey <[email-masked]> wrote:
>> +make_virtual_base() {
>> +               # Copied from git-merge-one-file.sh.
> I think the reasoning behind these patches is good.
>
> How do we feel about this duplication?
Bad.
> Should we make a common function in the git-sh-setup.sh,
> or is it okay to have a slightly modified version of this
> function in two places?
I'd prefer to have a common function, I just didn't know if there was 
somewhere appropriate to place it, available from both files. And I'm 
going to have to learn a bit more sh to get it right.
> Also, the "@@DIFF@@" string may not work here.
> This is a template string that is replaced by the Makefile.

It does work in git-mergetool--lib.sh, but not in mergetools/p4merge.

> We prefer $(command) instead of `command`.
> These should be adjusted.
>
> Can the same thing be accomplished using "git diff --no-index"
> so that we do not need a dependency on an external "diff" command here?
Do these comments still apply if it's a common function in 
git-sh-setup.sh that git-one-merge-file.sh will use? I'm wary of 
layering violations.

Kevin