git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Todd Zullinger <tmz@pobox.com>, git@vger.kernel.org
Subject: Re: Git fails to detect subcommand when hook is symlinked to a builtin
Date: Sun, 20 Mar 2011 03:20:20 -0500	[thread overview]
Message-ID: <20110320082020.GA12663@elie> (raw)
In-Reply-To: <7voc56rj9f.fsf@alter.siamese.dyndns.org>

Junio C Hamano wrote:

> Ok, that explains it.  update-server-info wasn't a built-in, so didn't
> have to look at its name to decide what to do.  It didn't have to spawn
> other git commands from GIT_EXEC_PATH so running the command directly
> without setting the environment variable happened to work.

Nice detective work.

> But such a usage (this doesn't have anything to do with the symlinking)
> was deprecated way before 1.5.4 [*1*], so the answer is still "don't do
> that" ;-)
[...]
> *1* http://thread.gmane.org/gmane.comp.version-control.git/93511

After rereading some of that thread (oops), I feel a small clarification
is in order.  Yes, the dashed named git-update-server-info is not the
name that that command would preferred to be called by, but if I
understand correctly, this is not what you are talking about having
being deprecated and removed.  Instead, the rule is:

 If you set your $PATH to include $(git --exec-path), then you may still
 run traditional git-<command>s using that dashed name.  Otherwise, you
 may be lucky and find it working (which is probably a bug :)) but
 please, just say no.[1]

Rationale: in that thread, the change to $PATH was agreed on as a
long-term workaround for preserving scripts and muscle memory.

Regards,
Jonathan

[1] In practice: the git wrapper adds GIT_EXEC_PATH to the $PATH and
traditional commands rely on finding it there.  For example, when
git-<command> is a shell script, it will tend to begin by reading in
some useful functions by running ". git-sh-setup", which relies on
git-sh-setup lying on the $PATH.

  reply	other threads:[~2011-03-20  8:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 15:14 Git fails to detect subcommand when hook is symlinked to a builtin Todd Zullinger
2011-03-19  0:53 ` Junio C Hamano
2011-03-19  1:14   ` Todd Zullinger
2011-03-19 19:40     ` Junio C Hamano
2011-03-20  8:20       ` Jonathan Nieder [this message]
2011-03-20  9:09         ` Jonathan Nieder

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=20110320082020.GA12663@elie \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tmz@pobox.com \
    /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).