From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <johannes.sixt@telecom.at>
Cc: Steffen Prohaska <prohaska@zib.de>,
git@vger.kernel.org,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH] Windows: set gitexecdir = $(bindir)
Date: Sat, 19 Jul 2008 10:28:05 -0700 [thread overview]
Message-ID: <7vmykd238a.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 200807191052.20057.johannes.sixt@telecom.at
Johannes Sixt <johannes.sixt@telecom.at> writes:
> On Samstag, 19. Juli 2008, Junio C Hamano wrote:
>> Sorry, I am not sure if I understand what you are trying to solve. If you
>> have ../libexec/git-core/ in GIT_EXEC_PATH (or have builtin_exec_path()
>> use it), then your installation would look like this:
>>
>> [[some random place]]
>> bin/git
>> libexec/git-core/git-add
>> libexec/git-core/git-del
>> libexec/git-core/git-dir
>> ...
>>
>> and if "git" can figure out it is "[[some random place]]/bin/git",
>> it can find its subcommands from neighbouring directory, that is still
>> inside the random place the user told the installer to use, can't it?
>
> Yes, but...
>
> Take as an example 'git pull'.
>
> - The first call to git will derive the exec-path
> $prefix/bin/../libexec/git-core and prepend it to $PATH.
>
> - Calls to builtin git commands from inside 'git pull' will then derive the
> exec-path $prefix/bin/../libexec/git-core/../libexec/git-core, that is
> $prefix/libexec/libexec/git-core, and prepend it to $PATH as well. That
> directory does not exist - usually - and it does not hurt. But it feels dirty
> and potentially dangerous.
You run "git" with an argument "pull". It needs to figure out where
"git-pull" is, it checks where it came from and adds ../libexec/git-core/.
Then it runs "git-pull" script.
Then the script may have a call to "git ls-files -u" or "git-merge".
- The former case, "git" again needs to find out where "git-ls-files"
is.
If "git" is found as bin/git and not as libexec/git-core/git, this
should be perfectly fine, isn't it? Perhaps we install a duplicate
copy there by mistake, which is what we need to fix?
- The latter case (our scripts source git-sh-setup so they have libexec
one in the PATH when they are started) would find "git-merge" directly
and runs it.
In either case, the programs "git-ls-files" and "git-merge" do not need to
do the same discovery -- are we giving them enough clues when we run them
to let them avoid that?
next prev parent reply other threads:[~2008-07-19 17:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 7:34 [PATCH] Windows related patches Johannes Sixt
2008-07-18 7:34 ` [PATCH] Teach lookup_prog not to select directories Johannes Sixt
2008-07-18 7:34 ` [PATCH] builtin-clone: Use is_dir_sep() instead of '/' Johannes Sixt
2008-07-18 7:34 ` [PATCH] Add ANSI control code emulation for the Windows console Johannes Sixt
2008-07-18 7:34 ` [PATCH] Windows: set gitexecdir = $(bindir) Johannes Sixt
2008-07-19 0:32 ` Junio C Hamano
2008-07-19 8:52 ` Johannes Sixt
2008-07-19 17:10 ` Steffen Prohaska
2008-07-19 17:28 ` Junio C Hamano [this message]
2008-07-19 19:31 ` Johannes Sixt
2008-07-19 0:32 ` [PATCH] builtin-clone: Use is_dir_sep() instead of '/' Junio C Hamano
2008-07-19 9:32 ` Johannes Sixt
2008-07-19 11:35 ` Johannes Schindelin
2008-07-19 13:49 ` Johannes Sixt
2008-07-19 17:44 ` Daniel Barkalow
2008-07-21 13:43 ` Kristian Høgsberg
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=7vmykd238a.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=johannes.sixt@telecom.at \
--cc=prohaska@zib.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).