Subject: Re: [PATCH 1/3] setup: Provide GIT_PREFIX to built-ins

From: David Aguilar <[email-masked]>
Date: Tue, 24 May 2011 21:19:28 -0700

On Mon, May 23, 2011 at 02:09:40PM +0200, Ævar Arnfjörð Bjarmason wrote:
> On Sun, May 22, 2011 at 11:57, David Aguilar <[email-masked]> wrote:
> > +       printf "#!/bin/sh\n" >diff &&
> > +       printf "printf \"\$GIT_PREFIX\"\n" >>diff &&
> 
> If you're going to use /bin/sh (which might be a non-POSIX shell) it's
> probably better to use echo than rely on printf understanding \n.

I'll reroll a v2 of these patches using echo instead of printf.
The mergetool--lib patch will make the test -z "$GIT_PREFIX"
check happen unconditionally as you suggested, Junio.

Another thought was that I could have implemented the
mergetool--lib patch without $GIT_PREFIX at all and just called
rev-parse --show-prefix explicitly.  The change has merits,
though, and I'll consider mergetool--lib not using rev-parse
as an optimization.  Afterall, fork+exec is expensive on
Windows so doing without an additional call is nicer for our
msysgit brothers.

Thank you both.
-- 
					David