All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <zeisberg@informatik.uni-freiburg.de>
To: git@vger.kernel.org
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <junkio@cox.net>
Subject: [RFC PATCH] rename --exec to --receive-pack for push and send-pack
Date: Fri, 19 Jan 2007 13:49:27 +0100	[thread overview]
Message-ID: <20070119124927.GA3039@cepheus> (raw)
In-Reply-To: <20070119124616.GA3012@cepheus>

For now it's just to get a more descriptive name.  Later we might update the
push protocol to run more than one program on the other end.  Moreover this
matches better the corresponding config option remote.<name>. receivepack.

--exec continues to work

Signed-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
---
Junio pointed out that remote.<name>.pushexec might not be appropriate,
"just in case we update the fetch/push protocol someday to run more than
one program on the other end".

In my eyes the consequence is to rename --exec to --receive-pack as is
done by this patch.

 Documentation/git-push.txt      |    7 +++++--
 Documentation/git-send-pack.txt |    7 +++++--
 builtin-push.c                  |   24 ++++++++++++++----------
 send-pack.c                     |   12 ++++++++----
 4 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 7a2e503..f8cc2b5 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -8,7 +8,7 @@ git-push - Update remote refs along with associated objects
 
 SYNOPSIS
 --------
-'git-push' [--all] [--tags] [--exec=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]
+'git-push' [--all] [--tags] [--receive-pack=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]
 
 DESCRIPTION
 -----------
@@ -67,12 +67,15 @@ the remote repository.
 	addition to refspecs explicitly listed on the command
 	line.
 
-\--exec::
+\--receive-pack=<git-receive-pack>::
 	Path to the 'git-receive-pack' program on the remote
 	end.  Sometimes useful when pushing to a remote
 	repository over ssh, and you do not have the program in
 	a directory on the default $PATH.
 
+\--exec=<git-receive-pack>::
+	Same as \--receive-pack=<git-receive-pack>.
+
 -f, \--force::
 	Usually, the command refuses to update a remote ref that is
 	not a descendant of the local ref used to overwrite it.
diff --git a/Documentation/git-send-pack.txt b/Documentation/git-send-pack.txt
index dee43a9..2f6267c 100644
--- a/Documentation/git-send-pack.txt
+++ b/Documentation/git-send-pack.txt
@@ -8,7 +8,7 @@ git-send-pack - Push objects over git protocol to another reposiotory
 
 SYNOPSIS
 --------
-'git-send-pack' [--all] [--force] [--exec=<git-receive-pack>] [--verbose] [--thin] [<host>:]<directory> [<ref>...]
+'git-send-pack' [--all] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [<host>:]<directory> [<ref>...]
 
 DESCRIPTION
 -----------
@@ -21,12 +21,15 @@ updates it from the current repository, sending named refs.
 
 OPTIONS
 -------
-\--exec=<git-receive-pack>::
+\--receive-pack=<git-receive-pack>::
 	Path to the 'git-receive-pack' program on the remote
 	end.  Sometimes useful when pushing to a remote
 	repository over ssh, and you do not have the program in
 	a directory on the default $PATH.
 
+\--exec=<git-receive-pack>::
+	Same as \--receive-pack=<git-receive-pack>.
+
 \--all::
 	Instead of explicitly specifying which refs to update,
 	update all refs that locally exist.
diff --git a/builtin-push.c b/builtin-push.c
index 6b3c03b..5f4d7d3 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -8,10 +8,10 @@
 
 #define MAX_URI (16)
 
-static const char push_usage[] = "git-push [--all] [--tags] [--exec=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]";
+static const char push_usage[] = "git-push [--all] [--tags] [--receive-pack=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]";
 
 static int all, tags, force, thin = 1, verbose;
-static const char *execute;
+static const char *receivepack;
 
 #define BUF_SIZE (2084)
 static char buffer[BUF_SIZE];
@@ -160,10 +160,10 @@ static int get_remote_config(const char* key, const char* value)
 			add_refspec(xstrdup(value));
 		else if (config_get_receivepack &&
 			 !strcmp(key + 7 + config_repo_len, ".receivepack")) {
-			if (!execute) {
-				char *ex = xmalloc(strlen(value) + 8);
-				sprintf(ex, "--exec=%s", value);
-				execute = ex;
+			if (!receivepack) {
+				char *rp = xmalloc(strlen(value) + 16);
+				sprintf(rp, "--receive-pack=%s", value);
+				receivepack = rp;
 			} else
 				error("more than one receivepack given, using the first");
 		}
@@ -178,7 +178,7 @@ static int get_config_remotes_uri(const char *repo, const char *uri[MAX_URI])
 	config_current_uri = 0;
 	config_uri = uri;
 	config_get_refspecs = !(refspec_nr || all || tags);
-	config_get_receivepack = (execute == NULL);
+	config_get_receivepack = (receivepack == NULL);
 
 	git_config(get_remote_config);
 	return config_current_uri;
@@ -263,8 +263,8 @@ static int do_push(const char *repo)
 		argv[argc++] = "--all";
 	if (force)
 		argv[argc++] = "--force";
-	if (execute)
-		argv[argc++] = execute;
+	if (receivepack)
+		argv[argc++] = receivepack;
 	common_argc = argc;
 
 	for (i = 0; i < n; i++) {
@@ -347,8 +347,12 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 			thin = 0;
 			continue;
 		}
+		if (!strncmp(arg, "--receive-pack=", 15)) {
+			receivepack = arg;
+			continue;
+		}
 		if (!strncmp(arg, "--exec=", 7)) {
-			execute = arg;
+			receivepack = arg;
 			continue;
 		}
 		usage(push_usage);
diff --git a/send-pack.c b/send-pack.c
index ec2c108..cd478dd 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -6,9 +6,9 @@
 #include "exec_cmd.h"
 
 static const char send_pack_usage[] =
-"git-send-pack [--all] [--force] [--exec=<git-receive-pack>] [--verbose] [--thin] [<host>:]<directory> [<ref>...]\n"
+"git-send-pack [--all] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [<host>:]<directory> [<ref>...]\n"
 "  --all and explicit <ref> specification are mutually exclusive.";
-static const char *exec = "git-receive-pack";
+static const char *receivepack = "git-receive-pack";
 static int verbose;
 static int send_all;
 static int force_update;
@@ -377,8 +377,12 @@ int main(int argc, char **argv)
 		char *arg = *argv;
 
 		if (*arg == '-') {
+			if (!strncmp(arg, "--receive-pack=", 15)) {
+				receivepack = arg + 15;
+				continue;
+			}
 			if (!strncmp(arg, "--exec=", 7)) {
-				exec = arg + 7;
+				receivepack = arg + 7;
 				continue;
 			}
 			if (!strcmp(arg, "--all")) {
@@ -413,7 +417,7 @@ int main(int argc, char **argv)
 		usage(send_pack_usage);
 	verify_remote_names(nr_heads, heads);
 
-	pid = git_connect(fd, dest, exec);
+	pid = git_connect(fd, dest, receivepack);
 	if (pid < 0)
 		return 1;
 	ret = send_pack(fd[0], fd[1], nr_heads, heads);
-- 
1.5.0.rc1.g581a


-- 
Uwe Kleine-König

exit vi, lesson II:
: w q ! <CR>

NB: write the current file

  reply	other threads:[~2007-01-19 12:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-19 12:43 [PATCH] Update documentation of fetch-pack, push and send-pack Uwe Kleine-König
2007-01-19 12:46 ` [PATCH] make --exec=... option to git-push configurable Uwe Kleine-König
2007-01-19 12:49   ` Uwe Kleine-König [this message]
2007-01-19 19:22 ` [PATCH] Update documentation of fetch-pack, push and send-pack Junio C Hamano
2007-01-23  8:20   ` [PATCH] rename --exec to --upload-pack for fetch-pack and peek-remote Uwe Kleine-König
2007-01-23  8:24     ` [PATCH] Use --upload-pack in clone, fetch and ls-remote instead of --exec Uwe Kleine-König
2007-01-23  8:40       ` Junio C Hamano
2007-01-23  9:25         ` Junio C Hamano
2007-01-23 14:05           ` Uwe Kleine-König

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=20070119124927.GA3039@cepheus \
    --to=zeisberg@informatik.uni-freiburg.de \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=spearce@spearce.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.