Re: [PATCH v3] To make GIT-VERSION-FILE, search for git more widely
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 4, 2009, 05:18 UTC
- Message-ID
- <7vvdnc37b6.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <200906022035.30081.j6t@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 34 quoted lines
> 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.
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