From: Kevin Bracey Date: Thu, 07 Mar 2013 06:28:00 GMT Subject: Re: [PATCH 2/2] p4merge: create a virtual base if none available Message-ID: <51383370.3050806@bracey.fi> In-Reply-To: On 07/03/2013 04:23, David Aguilar wrote: > On Wed, Mar 6, 2013 at 12:32 PM, Kevin Bracey 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