Re: [PATCH 2/2] p4merge: create a virtual base if none available
- From
Kevin Bracey <kevin@bracey.fi>
- Date
- Mar 7, 2013, 06:28 UTC
- Message-ID
- <51383370.3050806@bracey.fi>
- In-Reply-To
- <CAJDDKr6+VRnc-HK52woHHLtAqXau=76Gc+Ag=keiMGffuco64A@mail.gmail.com>
On 07/03/2013 04:23, David Aguilar wrote:
Show 6 quoted lines
> On Wed, Mar 6, 2013 at 12:32 PM, Kevin Bracey <kevin@bracey.fi> 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.
Show 5 quoted lines
> 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