Re: [PATCH] daemon: accept "git program" as well
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 25, 2008, 23:26 UTC
- Message-ID
- <7vmyl9w0y1.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080625230228.GR11793@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 11 quoted lines
> Junio C Hamano <gitster@pobox.com> wrote: >> This is a step to futureproof git-daemon to accept clients that >> ask for "git upload-pack" and friends, instead of using the more >> traditional dash-form "git-upload-pack". By allowing both, it >> makes the client side easier to handle, as it makes "git" the only >> thing necessary to be on $PATH when invoking the remote command >> directly via ssh. >> >> Signed-off-by: Junio C Hamano <gitster@pobox.com> > > Obviously correct. Ack. Thanks Junio.
By the way I looked at gitosis (Tommi CC'ed).
http://repo.or.cz/w/gitosis.git?a=blob;f=gitosis/serve.py;h=c0b7135bf45305ee1079b0dcab3b4ed1ce988aab;hb=38561aa6a51a2ef6cc04aa119481df62d213ffa4
In gitosis/serve.py, there are COMMANDS_READONLY and COMMANDS_WRITE array that holds 'git-upload-pack' and 'git-receive-pack' commands, and they are compared with user commands after doing:
verb, args = command.split(None, 1)
(and "verb" is looked up in the set of valid commands). It should not be too involved to notice verb is 'git' and then re-split the args part to see if they are upload-pack/receive-pack, which would be the equivalent change to this patch. It needs to be done before the clients are updated.