From: Todd Zullinger <tmz@pobox.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Git fails to detect subcommand when hook is symlinked to a builtin
Date: Fri, 18 Mar 2011 21:14:45 -0400 [thread overview]
Message-ID: <20110319011445.GL26236@inocybe.localdomain> (raw)
In-Reply-To: <7vhbb0rkv4.fsf@alter.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 2647 bytes --]
Junio C Hamano wrote:
> I have a suspicion that we may end up saying "don't do that", but
> let's ponder a bit with some technical background first. The "git"
> wrapper and builtin commands are all the same binary, and as a
> consequence, their main() function needs to decide what to do based
> on argv[0]. If argv[0] is "git", we know argv[1] is the name of the
> subcommand, and if argv[0] is "git-foo", it might be the internal
> call from the "git" wrapper that was invoked with argv[] = { "git",
> "foo", ... }, but we don't expect that argv[0] to be things like
> "post-update".
I can certainly understand that. :)
> But it is curious why the resulting behaviour changed recently. The
> symptom hints that the link target (git-update-server-info in your
> case) used to be given as argv[0] (which still wouldn't have been
> kosher---you are not supposed to use dashed form since 1.5.4 or so
> without adding $GIT_EXEC_PATH at the beginning of your $PATH, and
> that is why I said the first sentence in this reply), but we
> recently changed something and now we are getting
> "hooks/post-update" in argv[0].
>
> I suspect the recent change to run hooks via run_command() interface
> has something to do with it. From what version did you update to
> 1.7.4.1?
I should have mentioned it, but I failed to do so. Sorry about that.
This was moving from 1.5.5.6 to 1.7.4.1. The packages for EPEL (extra
stuff for RHEL/CentOS) lagged behind for quite some time. The
fedorahosted.org system was using 1.5.5.6 for a long time with the
symlinked post-update hook in place. But it's not necessarily
anything that changed recently in git. It could have been changes all
the way back in 1.6.0, which seems like an eternity in git time.
We already fixed up the repositories on fedorahosted for this, but I
figured I should ask, in case this change was not intended and might
catch other folks doing git hosting.
(The only other minor change that caught us was that some of the repos
did not have core.bare = true and pushes to these oddly configured
repositories failed. Clearly, that was a misconfiguration from the
time the repos were setup. Otherwise, for moving from 1.5.5.6 to
1.7.4.1, things went quite smoothly. That's thanks in no small part
to the great attention to detail you and the other folks on this list
have. Thank you!)
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The United States is a nation of laws, badly written and randomly
enforced.
-- Frank Zappa
[-- Attachment #2: Type: application/pgp-signature, Size: 542 bytes --]
next prev parent reply other threads:[~2011-03-19 1:15 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 [this message]
2011-03-19 19:40 ` Junio C Hamano
2011-03-20 8:20 ` Jonathan Nieder
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=20110319011445.GL26236@inocybe.localdomain \
--to=tmz@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitster@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