From: Junio C Hamano <gitster@pobox.com>
To: "Matthias Andree" <matthias.andree@gmx.de>
Cc: "Junio C Hamano" <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH v3] To make GIT-VERSION-FILE, search for git more widely
Date: Wed, 13 May 2009 12:32:31 -0700 [thread overview]
Message-ID: <7vy6t03ik0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <op.utva2vxh1e62zd@balu> (Matthias Andree's message of "Wed\, 13 May 2009 14\:17\:09 +0200")
"Matthias Andree" <matthias.andree@gmx.de> writes:
> Am 09.05.2009, 18:55 Uhr, schrieb Junio C Hamano <gitster@pobox.com>:
>
>> "Matthias Andree" <matthias.andree@gmx.de> writes:
>>
>>>> Fine then. Or you could just append "." to the $PATH ;-)
>>>
>>> "." in the super user's PATH? Cool stuff, and so innovative.
>>
>> I didn't mean to suggest PATH=$PATH:. *in the user's environment* ;-).
>> You do that inside GIT-VERSION-FILE, which is essentially the same thing
>> as running ./git$X from there.
>
> No, it is not -- the scope of the GIT variable is much narrower than
> doing PATH=$PATH:. in the script.
If you cannot trust the top of your build directory you build git in (that
is why PATH=$PATH:. while running GIT-VERSION-FILE may be scary) and
anticipate a malicious third-party can somehow put random things (like
"test" or "cat", perhaps) there, you are already lost, don't you think?
That is where my "essentially the same" came from.
> For any approach taken, we'll have to touch both the shell and the
> Makefile, unless we want to manually redo things in the
> GIT-VERSION-GEN script that were already done automatically or
> programmatically in Makefile.
I actually like the rationale you mentioned in the thread (perhaps in the
original proposed commit message as well) that we should ask the freshly
built git to describe the version if available, falling back to whichever
git of random vintage found on the original $PATH.
If it weren't for $X [*1*], my preference would have been (as I said in
the discussion) to run ./git if available locally.
But I think your "deal with details like $X to figure out the name of the
freshly built git binary is in the Makefile, and pass it via GIT variable
to GIT-VERSION-GEN" is a sensible approach. I do not remember if your
patch gave precedence to an installed git on the original $PATH or a
freshly built one, though---the precedent probably does not matter in
practice, and favoring the one found on $PATH over freshly built one does
have an advantage if we were to support cross compilation (I have a
suspicion that the current setup does not).
Thanks.
[Footnote]
*1* ... and perhaps VPATH as you mentioned earlier, but I do not know if
our current Makefile is set up to allow a layout that separates build
products from the source material, as I've never attempted to build git in
a setting where VPATH is involved.
next prev parent reply other threads:[~2009-05-13 19:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 9:22 [PATCH v3] To make GIT-VERSION-FILE, search for git more widely Matthias Andree
2009-05-07 11:49 ` Michael J Gruber
2009-05-07 12:04 ` Matthias Andree
2009-05-07 12:09 ` Michael J Gruber
2009-05-07 12:12 ` Matthias Andree
2009-05-08 0:05 ` Junio C Hamano
2009-05-08 8:27 ` Matthias Andree
2009-05-08 8:41 ` Junio C Hamano
2009-05-08 11:09 ` Matthias Andree
2009-05-09 16:55 ` Junio C Hamano
2009-05-09 17:10 ` Francis Galiegue
2009-05-09 18:17 ` Matthias Andree
2009-05-13 12:17 ` Matthias Andree
2009-05-13 19:32 ` Junio C Hamano [this message]
2009-06-02 10:55 ` Nanako Shiraishi
2009-06-02 15:50 ` Junio C Hamano
2009-06-02 18:35 ` Johannes Sixt
2009-06-03 7:32 ` Matthias Andree
2009-06-04 0:12 ` [PATCH v4] " Matthias Andree
2009-06-04 5:18 ` [PATCH v3] " Junio C Hamano
2009-06-04 8:35 ` Matthias Andree
2009-05-08 8:52 ` Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vy6t03ik0.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=matthias.andree@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).