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
MAMatthias Andree <matthias.andree@gmx.de>
Date
Jun 4, 2009, 08:35 UTC
Message-ID
<op.uuzrh8jr1e62zd@balu.cs.uni-paderborn.de>
In-Reply-To
<7vvdnc37b6.fsf@alter.siamese.dyndns.org>
Am 04.06.2009, 07:18 Uhr, schrieb Junio C Hamano <gitster@pobox.com>:
Show 45 quoted lines
> Johannes Sixt <j6t@kdbg.org> writes:
>
>> On Dienstag, 2. Juni 2009, Junio C Hamano wrote:
>>> Nanako Shiraishi <nanako3@lavabit.com> writes:
>>> > Junio, I think you forgot to take a follow-up action on this thread  
>>> after
>>> > sending this message.  The patch favors the git program in the  
>>> current
>>> > directory.
>>>
>>> Indeed, I did, and I think I am Ok with the patch.  Thanks for a
>>> reminder.
>>>
>>> I thought there was an "simplicity" issue raised by J6t that was not
>>> addressed, but after re-reading the thread I do not think it applies
>>> (J6t?)
>>
>> Sorry, I don't recall anymore what I said; but since the thread petered  
>> out, I
>> use this patch in the repository where I share Matthias' 'sudo make  
>> install'
>> problem:
>>
>> Subject: [PATCH] version-gen: Use just built git if no other git is in  
>> PATH
>>
>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
>>
>> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
>> index 39cde78..4779313 100755
>> --- a/GIT-VERSION-GEN
>> +++ b/GIT-VERSION-GEN
>> @@ -3,6 +3,9 @@
>>  GVF=GIT-VERSION-FILE
>>  DEF_VER=v1.6.3.GIT
>>
>> +# use git that was just compiled if there is no git elsewhere in PATH
>> +PATH=$PATH:.
>> +
>>  LF='
>>  '
>
> I actually think this is much saner and cleaner (it certainly is  
> smaller),
> especially having seen Matthias's v4, which feels a tad overengineered.
It's nothing more than

(a) followed your suggestion to look in $(prefix) first for cross-building support

(b) ported to git-gui as well (copy & paste-style)

Also, we certainly do not want to stuff "." in root's PATH, not even for simple scripts like GIT-VERSION-GEN.

Show 6 quoted lines
> I honestly do not understand why we need to bend backwards to cater to
> "sudo".  Real men, when needing to do things as root, have always done
> "su", and _if_ the environment is unsuited for the job, they can do:
>
> 	$ su
>         # PATH=$PATH:/usr/local/bin make prefix=/usr/local install

sudo caches passwords for a couple of minutes, su does not, and su isn't available everywhere ("wheel" group on BSD and stuff); particularly, sudo is *the* get-root-tool on Ubuntu.

If you argue "real men", then break that damn rebuild cycle and either fix dependencies properly, rather than second-guessing in shell scripts at "make install" time, or add post-update hooks (or whatever) to update the GIT-VERSION-FILE...

"." doesn't belong in root's $PATH, period.
-- 
Matthias Andree
Previous: Junio C HamanoNext: Johannes Sixt
Message 21 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.