From: David Aguilar Date: Wed, 25 May 2011 04:19:28 GMT Subject: Re: [PATCH 1/3] setup: Provide GIT_PREFIX to built-ins Message-ID: <20110525041926.GB21810@gmail.com> In-Reply-To: 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 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