Skip to contentSkip to conversation

Update documentation of fetch-pack, push and send-pack

PATCH In review Uwe Kleine-König 3 participants 9 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update documentation of fetch-pack, push and send-pack

add all supported options to Documentation/git-....txt and the usage strings.

---

This patch is included in this series to have the later patches only updating the documentation to follow the code changes.

@Junio: If you take this (or one of the following) patch(es), could you please give me feedback on how my 'ö' got to you?

 Documentation/git-fetch-pack.txt |   21 +++++++++++++++++----
 Documentation/git-push.txt       |    2 +-
 Documentation/git-send-pack.txt  |   15 +++++++++++----
 builtin-push.c                   |    2 +-
 fetch-pack.c                     |    2 +-
 send-pack.c                      |    4 ++--
 6 files changed, 33 insertions(+), 13 deletions(-)
Documentation/git-fetch-pack.txt +17 -4
index 90ef127..bd8ebac 100644
@@ -8,7 +8,7 @@ git-fetch-pack - Receive missing objects from another repository
 
 SYNOPSIS
 --------
-'git-fetch-pack' [-q] [-k] [--exec=<git-upload-pack>] [<host>:]<directory> [<refs>...]
+'git-fetch-pack' [--all] [--quiet|-q] [--keep|-k] [--thin] [--exec=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]
 
 DESCRIPTION
 -----------
@@ -28,17 +28,24 @@ have a common ancestor commit.
 
 OPTIONS
 -------
--q::
+\--all::
+	Fetch all remote refs.
+
+\--quiet, \-q::
 	Pass '-q' flag to 'git-unpack-objects'; this makes the
 	cloning process less verbose.
 
--k::
+\--keep, \-k::
 	Do not invoke 'git-unpack-objects' on received data, but
 	create a single packfile out of it instead, and store it
 	in the object database. If provided twice then the pack is
 	locked against repacking.
 
---exec=<git-upload-pack>::
+\--thin::
+	Spend extra cycles to minimize the number of objects to be sent.
+	Use it on slower connection.
+
+\--exec=<git-upload-pack>::
 	Use this to specify the path to 'git-upload-pack' on the
 	remote side, if is not found on your $PATH.
 	Installations of sshd ignores the user's environment
@@ -50,6 +57,12 @@ OPTIONS
 	shells by having a lean .bashrc file (they set most of
 	the things up in .bash_profile).
 
+\--depth=<n>::
+	Limit fetching to ancestor-chains not longer than n.
+
+\-v::
+	Run verbosely.
+
 <host>::
 	A remote host that houses the repository.  When this
 	part is specified, 'git-upload-pack' is invoked via
Documentation/git-push.txt +1 -1
index 3e8dbcf..7a2e503 100644
@@ -8,7 +8,7 @@ git-push - Update remote refs along with associated objects
 
 SYNOPSIS
 --------
-'git-push' [--all] [--tags] [--exec=<receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]
+'git-push' [--all] [--tags] [--exec=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]
 
 DESCRIPTION
 -----------
Documentation/git-send-pack.txt +11 -4
index eea8fe8..dee43a9 100644
@@ -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>] [<host>:]<directory> [<ref>...]
+'git-send-pack' [--all] [--force] [--exec=<git-receive-pack>] [--verbose] [--thin] [<host>:]<directory> [<ref>...]
 
 DESCRIPTION
 -----------
@@ -21,23 +21,30 @@ updates it from the current repository, sending named refs.
 
 OPTIONS
 -------
---exec=<git-receive-pack>::
+\--exec=<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.
 
---all::
+\--all::
 	Instead of explicitly specifying which refs to update,
 	update all refs that locally exist.
 
---force::
+\--force::
 	Usually, the command refuses to update a remote ref that
 	is not an ancestor of the local ref used to overwrite it.
 	This flag disables the check.  What this means is that
 	the remote repository can lose commits; use it with
 	care.
 
+\--verbose::
+	Run verbosely.
+
+\--thin::
+	Spend extra cycles to minimize the number of objects to be sent.
+	Use it on slower connection.
+
 <host>::
 	A remote host to house the repository.  When this
 	part is specified, 'git-receive-pack' is invoked via
builtin-push.c +1 -1
index 7a3d2bb..ba7981f 100644
@@ -8,7 +8,7 @@
 
 #define MAX_URI (16)
 
-static const char push_usage[] = "git-push [--all] [--tags] [-f | --force] <repository> [<refspec>...]";
+static const char push_usage[] = "git-push [--all] [--tags] [--exec=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]";
 
 static int all, tags, force, thin = 1, verbose;
 static const char *execute;
fetch-pack.c +1 -1
index 1530a94..726140a 100644
@@ -12,7 +12,7 @@ static int verbose;
 static int fetch_all;
 static int depth;
 static const char fetch_pack_usage[] =
-"git-fetch-pack [--all] [-q] [-v] [-k] [--thin] [--exec=upload-pack] [--depth=<n>] [host:]directory <refs>...";
+"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--exec=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]";
 static const char *exec = "git-upload-pack";
 
 #define COMPLETE	(1U << 0)
send-pack.c +2 -2
index 6756264..ec2c108 100644
@@ -6,8 +6,8 @@
 #include "exec_cmd.h"
 
 static const char send_pack_usage[] =
-"git-send-pack [--all] [--exec=git-receive-pack] <remote> [<head>...]\n"
-"  --all and explicit <head> specification are mutually exclusive.";
+"git-send-pack [--all] [--force] [--exec=<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 int verbose;
 static int send_all;
Signature · 8 lines
1.5.0.rc1.g581a


-- 
Uwe Kleine-König

primes where sieve (p:xs) = [ x | x<-xs, x `rem` p /= 0 ]; \
primes = map head (iterate sieve [2..])
#1 lore raw

PATCH 1/1 make --exec=... option to git-push configurable

Having to specify git push --exec=... is annoying if you cannot have git-receivepack in your PATH on the remote side (or don't want to).

This introduces the config item remote.<name>.receivepack to override the default value (which is "git-receive-pack").

---

This is the already known patch with s/pushexec/receivepack/

Just now I realized that I missed to add a In-Reply-To: to the first mail. I hope you can match it anyhow.

 Documentation/config.txt |    4 ++++
 builtin-push.c           |   11 +++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
Documentation/config.txt +4 -0
index da7fde5..f1f409d 100644
@@ -356,6 +356,10 @@ remote.<name>.push::
 	The default set of "refspec" for gitlink:git-push[1]. See
 	gitlink:git-push[1].
 
+remote.<name>.receivepack::
+	The default program to execute on the remote side when pulling.  See
+	option \--exec of gitlink:git-push[1].
+
 repack.usedeltabaseoffset::
 	Allow gitlink:git-repack[1] to create packs that uses
 	delta-base offset.  Defaults to false.
builtin-push.c +11 -0
index ba7981f..6b3c03b 100644
@@ -143,6 +143,7 @@ static const char *config_repo;
 static int config_repo_len;
 static int config_current_uri;
 static int config_get_refspecs;
+static int config_get_receivepack;
 
 static int get_remote_config(const char* key, const char* value)
 {
@@ -157,6 +158,15 @@ static int get_remote_config(const char* key, const char* value)
 		else if (config_get_refspecs &&
 			 !strcmp(key + 7 + config_repo_len, ".push"))
 			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;
+			} else
+				error("more than one receivepack given, using the first");
+		}
 	}
 	return 0;
 }
@@ -168,6 +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);
 
 	git_config(get_remote_config);
 	return config_current_uri;
Signature · 7 lines
1.5.0.rc1.g581a


-- 
Uwe Kleine-König

http://www.google.com/search?q=e+%5E+%28i+pi%29
#2 lore raw

RFC PATCH 1/1 rename --exec to --receive-pack for push and send-pack

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

---
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(-)
Documentation/git-push.txt +5 -2
index 7a2e503..f8cc2b5 100644
@@ -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.
Documentation/git-send-pack.txt +5 -2
index dee43a9..2f6267c 100644
@@ -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.
builtin-push.c +14 -10
index 6b3c03b..5f4d7d3 100644
@@ -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);
send-pack.c +8 -4
index ec2c108..cd478dd 100644
@@ -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);
Signature · 10 lines
1.5.0.rc1.g581a


-- 
Uwe Kleine-König

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

NB: write the current file
#3 lore raw
In reply to Uwe Kleine-König

I think this series, including the last RFC one, is very sensible. Even though, strictly speaking, this is a new feature, I think we should have it in 1.5.0.

We would need a similar change on fetch-pack and peek-remote side.

#4 lore raw

PATCH 1/1 rename --exec to --upload-pack for fetch-pack and peek-remote

Just some option name disambiguation. This is the counter part to commit d23842fd53e61f32c189a6ec902c4133abf29878 which made a similar change for push and send-pack.

--exec continues to work.

---
 Documentation/git-fetch-pack.txt  |    7 +++++--
 Documentation/git-peek-remote.txt |    7 +++++--
 fetch-pack.c                      |   12 ++++++++----
 peek-remote.c                     |   12 ++++++++----
 4 files changed, 26 insertions(+), 12 deletions(-)
Documentation/git-fetch-pack.txt +5 -2
index bd8ebac..105d76b 100644
@@ -8,7 +8,7 @@ git-fetch-pack - Receive missing objects from another repository
 
 SYNOPSIS
 --------
-'git-fetch-pack' [--all] [--quiet|-q] [--keep|-k] [--thin] [--exec=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]
+'git-fetch-pack' [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]
 
 DESCRIPTION
 -----------
@@ -45,7 +45,7 @@ OPTIONS
 	Spend extra cycles to minimize the number of objects to be sent.
 	Use it on slower connection.
 
-\--exec=<git-upload-pack>::
+\--upload-pack=<git-upload-pack>::
 	Use this to specify the path to 'git-upload-pack' on the
 	remote side, if is not found on your $PATH.
 	Installations of sshd ignores the user's environment
@@ -57,6 +57,9 @@ OPTIONS
 	shells by having a lean .bashrc file (they set most of
 	the things up in .bash_profile).
 
+\--exec=<git-upload-pack>::
+	Same as \--upload-pack=<git-upload-pack>.
+
 \--depth=<n>::
 	Limit fetching to ancestor-chains not longer than n.
 
Documentation/git-peek-remote.txt +5 -2
index ac57cda..74f37bd 100644
@@ -8,7 +8,7 @@ git-peek-remote - List the references in a remote repository
 
 SYNOPSIS
 --------
-'git-peek-remote' [--exec=<git-upload-pack>] [<host>:]<directory>
+'git-peek-remote' [--upload-pack=<git-upload-pack>] [<host>:]<directory>
 
 DESCRIPTION
 -----------
@@ -17,7 +17,7 @@ stores them in the local repository under the same name.
 
 OPTIONS
 -------
---exec=<git-upload-pack>::
+\--upload-pack=<git-upload-pack>::
 	Use this to specify the path to 'git-upload-pack' on the
 	remote side, if it is not found on your $PATH. Some
 	installations of sshd ignores the user's environment
@@ -29,6 +29,9 @@ OPTIONS
 	shells, but prefer having a lean .bashrc file (they set most of
 	the things up in .bash_profile).
 
+\--exec=<git-upload-pack>::
+	Same \--upload-pack=<git-upload-pack>.
+
 <host>::
 	A remote host that houses the repository.  When this
 	part is specified, 'git-upload-pack' is invoked via
fetch-pack.c +8 -4
index 726140a..3546aef 100644
@@ -12,8 +12,8 @@ static int verbose;
 static int fetch_all;
 static int depth;
 static const char fetch_pack_usage[] =
-"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--exec=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]";
-static const char *exec = "git-upload-pack";
+"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]";
+static const char *uploadpack = "git-upload-pack";
 
 #define COMPLETE	(1U << 0)
 #define COMMON		(1U << 1)
@@ -643,8 +643,12 @@ int main(int argc, char **argv)
 		char *arg = argv[i];
 
 		if (*arg == '-') {
+			if (!strncmp("--upload-pack=", arg, 14)) {
+				uploadpack = arg + 14;
+				continue;
+			}
 			if (!strncmp("--exec=", arg, 7)) {
-				exec = arg + 7;
+				uploadpack = arg + 7;
 				continue;
 			}
 			if (!strcmp("--quiet", arg) || !strcmp("-q", arg)) {
@@ -682,7 +686,7 @@ int main(int argc, char **argv)
 	}
 	if (!dest)
 		usage(fetch_pack_usage);
-	pid = git_connect(fd, dest, exec);
+	pid = git_connect(fd, dest, uploadpack);
 	if (pid < 0)
 		return 1;
 	if (heads && nr_heads)
peek-remote.c +8 -4
index 353da00..ef3c76c 100644
@@ -3,8 +3,8 @@
 #include "pkt-line.h"
 
 static const char peek_remote_usage[] =
-"git-peek-remote [--exec=upload-pack] [host:]directory";
-static const char *exec = "git-upload-pack";
+"git-peek-remote [--upload-pack=<git-upload-pack>] [<host>:]<directory>";
+static const char *uploadpack = "git-upload-pack";
 
 static int peek_remote(int fd[2], unsigned flags)
 {
@@ -35,8 +35,12 @@ int main(int argc, char **argv)
 		char *arg = argv[i];
 
 		if (*arg == '-') {
+			if (!strncmp("--upload-pack=", arg, 14)) {
+				uploadpack = arg + 14;
+				continue;
+			}
 			if (!strncmp("--exec=", arg, 7)) {
-				exec = arg + 7;
+				uploadpack = arg + 7;
 				continue;
 			}
 			if (!strcmp("--tags", arg)) {
@@ -60,7 +64,7 @@ int main(int argc, char **argv)
 	if (!dest || i != argc - 1)
 		usage(peek_remote_usage);
 
-	pid = git_connect(fd, dest, exec);
+	pid = git_connect(fd, dest, uploadpack);
 	if (pid < 0)
 		return 1;
 	ret = peek_remote(fd, flags);
Signature · 7 lines
1.5.0.rc1.g581a


-- 
Uwe Kleine-König

http://www.google.com/search?q=1+hertz+in+sec**-1
#5 lore raw

PATCH 1/1 Use --upload-pack in clone, fetch and ls-remote instead of --exec

---
I don't like the change to git-fetch.sh. But currently git-fetch-pack needs a = and ls-remote doesn't like it. So it continues to have two variables for the remote upload program.

 git-clone.sh     |    2 +-
 git-fetch.sh     |    2 +-
 git-ls-remote.sh |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
git-clone.sh +1 -1
index 0f7bbbf..d652c00 100755
@@ -163,7 +163,7 @@ while
 	1,-u|1,--upload-pack) usage ;;
 	*,-u|*,--upload-pack)
 		shift
-		upload_pack="--exec=$1" ;;
+		upload_pack="--upload-pack=$1" ;;
 	1,--depth) usage;;
 	*,--depth)
 		shift
git-fetch.sh +1 -1
index 87b940b..2279991 100755
@@ -34,7 +34,7 @@ do
 	--upl|--uplo|--uploa|--upload|--upload-|--upload-p|\
 	--upload-pa|--upload-pac|--upload-pack)
 		shift
-		exec="--exec=$1" 
+		exec="--upload-pack=$1" 
 		upload_pack="-u $1"
 		;;
 	-f|--f|--fo|--for|--forc|--force)
git-ls-remote.sh +1 -1
index 03b624e..e9e79e2 100755
@@ -23,7 +23,7 @@ do
   -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\
   --upload-pac|--upload-pack)
 	shift
-	exec="--exec=$1"
+	exec="--upload-pack=$1"
 	shift;;
   --)
   shift; break ;;
Signature · 7 lines
1.5.0.rc1.g581a


-- 
Uwe Kleine-König

http://www.google.com/search?q=2004+in+roman+numerals
#6 lore raw

Re: [PATCH] Use --upload-pack in clone, fetch and ls-remote instead of --exec

Quoted 5 lines · Uwe Kleine-König

---
I don't like the change to git-fetch.sh. But currently git-fetch-pack needs a = and ls-remote doesn't like it. So it continues to have two variables for the remote upload program.

Then maybe something like this is in order to make things more consistent?

Totally untested, of course ;-).

git-ls-remote.sh +4 -0
index 03b624e..69d4c2a 100755
@@ -25,6 +25,10 @@ do
 	shift
 	exec="--exec=$1"
 	shift;;
+  -u=*|--u=*|--up=*|--upl=*|--uplo=*|--uploa=*|--upload=*|\
+  --upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)
+  	exec=--exec=`expr "$1" : '-[^=]*=\(.*\)'`
+	shift;;
   --)
   shift; break ;;
   -*)
#7 lore raw

Re: [PATCH] Use --upload-pack in clone, fetch and ls-remote instead of --exec

Quoted 10 lines · Junio C Hamano
Quoted 5 lines · Uwe Kleine-König

---
I don't like the change to git-fetch.sh. But currently git-fetch-pack needs a = and ls-remote doesn't like it. So it continues to have two variables for the remote upload program.

Then maybe something like this is in order to make things more consistent?

Merging these two together,...

-- >8 --
[PATCH] ls-remote and clone: accept --upload-pack=<path> as well.

This makes them consistent with other commands that take the path to the upload-pack program. We also pass --upload-pack instead of --exec to the underlying fetch-pack, although it is not strictly necessary.

[jc: original motivation from Uwe]

---
 git-clone.sh     |    4 +++-
 git-fetch.sh     |   11 +++++++----
 git-ls-remote.sh |    6 +++++-
 3 files changed, 15 insertions(+), 6 deletions(-)
git-clone.sh +3 -1
index 0f7bbbf..ced7dfb 100755
@@ -163,7 +163,9 @@ while
 	1,-u|1,--upload-pack) usage ;;
 	*,-u|*,--upload-pack)
 		shift
-		upload_pack="--exec=$1" ;;
+		upload_pack="--upload-pack=$1" ;;
+	*,--upload-pack=*)
+		upload_pack=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)') ;;
 	1,--depth) usage;;
 	*,--depth)
 		shift
git-fetch.sh +7 -4
index 87b940b..07a1d05 100755
@@ -22,7 +22,6 @@ force=
 verbose=
 update_head_ok=
 exec=
-upload_pack=
 keep=
 shallow_depth=
 while case "$#" in 0) break ;; esac
@@ -34,8 +33,12 @@ do
 	--upl|--uplo|--uploa|--upload|--upload-|--upload-p|\
 	--upload-pa|--upload-pac|--upload-pack)
 		shift
-		exec="--exec=$1" 
-		upload_pack="-u $1"
+		exec="--upload-pack=$1"
+		;;
+	--upl=*|--uplo=*|--uploa=*|--upload=*|\
+	--upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)
+		exec=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)')
+		shift
 		;;
 	-f|--f|--fo|--for|--forc|--force)
 		force=t
@@ -94,7 +97,7 @@ then
 fi
 
 # Global that is reused later
-ls_remote_result=$(git ls-remote $upload_pack "$remote") ||
+ls_remote_result=$(git ls-remote $exec "$remote") ||
 	die "Cannot get the repository state from $remote"
 
 append_fetch_head () {
git-ls-remote.sh +5 -1
index 03b624e..dd22783 100755
@@ -23,7 +23,11 @@ do
   -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\
   --upload-pac|--upload-pack)
 	shift
-	exec="--exec=$1"
+	exec="--upload-pack=$1"
+	shift;;
+  -u=*|--u=*|--up=*|--upl=*|--uplo=*|--uploa=*|--upload=*|\
+  --upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)
+	exec=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)')
 	shift;;
   --)
   shift; break ;;
Signature · 1 line
1.5.0.rc2.g4e4d0
#8 lore raw

Re: [PATCH] Use --upload-pack in clone, fetch and ls-remote instead of --exec

Quoted 10 lines · Junio C Hamano

[PATCH] ls-remote and clone: accept --upload-pack=<path> as well.

This makes them consistent with other commands that take the path to the upload-pack program. We also pass --upload-pack instead of --exec to the underlying fetch-pack, although it is not strictly necessary.

[jc: original motivation from Uwe]

Signature · 3 lines
Uwe Kleine-König

$ dc -e "5735816763073014741799356604682P"