Subject: Re: [PATCH v3] To make GIT-VERSION-FILE, search for git more widely

From: "Matthias Andree" <[email-masked]>
Date: Thu, 07 May 2009 14:04:59 +0200

Am 07.05.2009, 13:49 Uhr, schrieb Michael J Gruber  
<[email-masked]>:

> Matthias Andree venit, vidit, dixit 07.05.2009 11:22:
> ...
>> The underlying problem flow is:
>>
>> 1 - Makefile has "include GIT-VERSION-FILE", thus gmake builds
>>     GIT-VERSION-FILE early.
>> 2 - GIT-VERSION-FILE depends on a .PHONY target  
>> (.FORCE-GIT-VERSION-FILE)
>> 3 - Thus, GNU make *always* executes GIT-VERSION-GEN
>> 4 - GIT-VERSION-GEN now, under the stripped $PATH, cannot find "git" and
>>     sees a different version number.
>> 5 - GIT-VERSION-GEN notes the difference in versions and regenerates
>>     GIT-VERSION-FILE, with up-to-date timestamp.
>> 6 - GNU make rebuilds everything because GIT-VERSION-FILE is new.
>>
>> The patch makes GIT-VERSION-GEN look for the current built git$X  
>> executable,
>> and in $(prefix)/bin/git, before falling back to plain "git" and thus  
>> to the
>> default version in GIT-VERSION-GEN.
>
> Thanks for the detailed analysis, now I g[oi]t it!
> According to the analysis, the problem would also appear with a standard
> make run (without configure) as long as git is not in the sudoer's $PATH
> ($prefix isn't, no distro git in /usr).

I am not sure how useful /this/ example is -- prefix=$HOME is default, no  
sudo required. make prefix=/opt/git might be a point though.

> [commit/diff]
> Looks good to me. So, untested but reviewed by me.

Thanks.

-- 
Matthias Andree