git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
May 7, 2009, 12:09 UTC
Message-ID
<4A02CF67.1010401@drmicha.warpmail.net>
In-Reply-To
<op.utj6ikav1e62zd@balu>
Matthias Andree venit, vidit, dixit 07.05.2009 14:04:
Show 31 quoted lines
> Am 07.05.2009, 13:49 Uhr, schrieb Michael J Gruber  
> <git@drmicha.warpmail.net>:
> 
>> 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.
That's what I meant by my admittedly fuzzy "$prefix isn't".

I just wanted to point out that your PATCH fixes an easy which also "ordinary" make usage (with prefix and sudo) has, because autoconf/configure is considered a 2nd class citizen.

Show 5 quoted lines
>> [commit/diff]
>> Looks good to me. So, untested but reviewed by me.
> 
> Thanks.
> 

Cheers, Michael

Previous: Matthias AndreeNext: Matthias Andree
Message 4 of 22 in “To make GIT-VERSION-FILE, search for git more widely”
  1. To make GIT-VERSION-FILE, search for git more widelyMatthias Andree, May 7, 2009
  2. Michael J GruberMay 7, 2009
  3. Matthias AndreeMay 7, 2009
  4. Michael J GruberMay 7, 2009
  5. Matthias AndreeMay 7, 2009
  6. Junio C HamanoMay 8, 2009
  7. Matthias AndreeMay 8, 2009
  8. Junio C HamanoMay 8, 2009
  9. Matthias AndreeMay 8, 2009
  10. Junio C HamanoMay 9, 2009
  11. Francis GaliegueMay 9, 2009
  12. Matthias AndreeMay 9, 2009
  13. Matthias AndreeMay 13, 2009
  14. Junio C HamanoMay 13, 2009
  15. Nanako ShiraishiJun 2, 2009
  16. Junio C HamanoJun 2, 2009
  17. Johannes SixtJun 2, 2009
  18. Matthias AndreeJun 3, 2009
  19. To make GIT-VERSION-FILE, search for git more widelyMatthias Andree, Jun 4, 2009
  20. Junio C HamanoJun 4, 2009
  21. Matthias AndreeJun 4, 2009
  22. Johannes SixtMay 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.