git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git fails to detect subcommand when hook is symlinked to a builtin
@ 2011-03-18 15:14 Todd Zullinger
  2011-03-19  0:53 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Todd Zullinger @ 2011-03-18 15:14 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

I'm not sure if this is a bug or more of a "don't do that" sort of
thing.  At fedorahosted.org, the git repositories are mounted on a
filesystem with noexec.  As such, we have all hooks symlinked
elsewhere.  For the post-update hook we used to link directly to
git-update-server-info.

This worked until we upgraded the system to git-1.7.4.1 recently.  A
trace may help illustrate:

With hooks/post-update as a symlink to
/usr/bin/git-update-server-info:

trace: run_command: 'hooks/post-update' 'refs/heads/master'
trace: run_command: 'gc' '--auto' '--quiet'
remote: trace: exec: 'git-refs/heads/master'
remote: trace: run_command: 'git-refs/heads/master'
remote: git: 'refs/heads/master' is not a git command. See 'git --help'.

With hooks/post-update as a symlink to
/usr/share/git-core/templates/hooks/post-update.sample:

trace: run_command: 'hooks/post-update' 'refs/heads/master'
remote: setup: git_dir: .
remote: setup: worktree: (null)
remote: setup: cwd: /home/fedora/tmz/tmp/iwhd.git
remote: setup: prefix: (null)
remote: trace: built-in: git 'update-server-info'

Is there any reasonable way to handle this case?  Perhaps if the
symlink were dereferenced (if no subcommand were found) and then
re-checked for a subcommand?  I admit that I did not delve too deeply
into the code, but from the little I did I wasn't sure that any
changes here wouldn't lead to worse troubles.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Everyone needs to believe in something. I believe I'll have another
beer.


[-- Attachment #2: Type: application/pgp-signature, Size: 542 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-20  9:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-03-20  9:09         ` Jonathan Nieder

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).