[PATCH] daemon: accept "git program" as well

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---

 "Shawn O. Pearce" <spearce@xxxxxxxxxxx> writes:

 > Junio C Hamano <gitster@xxxxxxxxx> wrote:
 >
 >> Ok, let's map this out seriously.
 >
 > This plan makes a lot of sense to me.  I'm behind it.  For whatever
 > that means.  At least I'll shutup and stop making noise about this
 > issue if you take this approach.  :-)
 >  
 >> * 1.6.0 will install the server-side programs in $(bindir) so that 
 >>   people coming over ssh will find them on the $PATH
 >> 
 >> * In 1.6.0 (and 1.5.6.1), we will change "git daemon" to accept both
 >>   "git-program" and "git program" forms.  When the spaced form is used, it
 >>   will behave as if the dashed form is requested.  This is a prerequisite
 >>   for client side change to start asking for "git program".
 >> 
 >> * In the near future, there will no client-side change.  "git-program"
 >>   will be asked for.
 >> 
 >> * 6 months after 1.6.0 ships, hopefully all the deployed server side will
 >>   be running that version or newer.  Client side will start asking for
 >>   "git program" by default, but we can still override with --upload-pack
 >>   and friends.
 >> 
 >> * 12 months after client side changes, everybody will be running that
 >>   version or newer.  We stop installing the server side programs in
 >>   $(bindir) but people coming over ssh will be asking for "git program"
 >>   and "git" will be on the $PATH so there is no issue.
 >> 
 >> The above 6 and 12 are yanked out of thin air and I am of course open to
 >> tweaking them, but I think the above order of events would be workable.
 >
 > Yea, 6 and 12 seem like a good idea.  Its a couple of releases and
 > gives people time to migrate their server installations.

 So this obviously needs to be queued to 'maint' to be included in 1.5.6.1
 and 1.6.0.

 daemon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daemon.c b/daemon.c
index 63cd12c..621c567 100644
--- a/daemon.c
+++ b/daemon.c
@@ -586,7 +586,7 @@ static int execute(struct sockaddr *addr)
 	for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
 		struct daemon_service *s = &(daemon_service[i]);
 		int namelen = strlen(s->name);
-		if (!prefixcmp(line, "git-") &&
+		if ((!prefixcmp(line, "git-") || !prefixcmp(line, "git ")) &&
 		    !strncmp(s->name, line + 4, namelen) &&
 		    line[namelen + 4] == ' ') {
 			/*
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux