Browse Source

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

Signed-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Uwe Kleine-König 18 years ago committed by Junio C Hamano
parent
commit
d23842fd53
  1. 7
      Documentation/git-push.txt
  2. 7
      Documentation/git-send-pack.txt
  3. 24
      builtin-push.c
  4. 12
      send-pack.c

7
Documentation/git-push.txt

@ -8,7 +8,7 @@ git-push - Update remote refs along with associated objects


SYNOPSIS 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 DESCRIPTION
----------- -----------
@ -67,12 +67,15 @@ the remote repository.
addition to refspecs explicitly listed on the command addition to refspecs explicitly listed on the command
line. line.


\--exec:: \--receive-pack=<git-receive-pack>::
Path to the 'git-receive-pack' program on the remote Path to the 'git-receive-pack' program on the remote
end. Sometimes useful when pushing to a remote end. Sometimes useful when pushing to a remote
repository over ssh, and you do not have the program in repository over ssh, and you do not have the program in
a directory on the default $PATH. a directory on the default $PATH.


\--exec=<git-receive-pack>::
Same as \--receive-pack=<git-receive-pack>.

-f, \--force:: -f, \--force::
Usually, the command refuses to update a remote ref that is Usually, the command refuses to update a remote ref that is
not a descendant of the local ref used to overwrite it. not a descendant of the local ref used to overwrite it.

7
Documentation/git-send-pack.txt

@ -8,7 +8,7 @@ git-send-pack - Push objects over git protocol to another reposiotory


SYNOPSIS 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 DESCRIPTION
----------- -----------
@ -21,12 +21,15 @@ updates it from the current repository, sending named refs.


OPTIONS OPTIONS
------- -------
\--exec=<git-receive-pack>:: \--receive-pack=<git-receive-pack>::
Path to the 'git-receive-pack' program on the remote Path to the 'git-receive-pack' program on the remote
end. Sometimes useful when pushing to a remote end. Sometimes useful when pushing to a remote
repository over ssh, and you do not have the program in repository over ssh, and you do not have the program in
a directory on the default $PATH. a directory on the default $PATH.


\--exec=<git-receive-pack>::
Same as \--receive-pack=<git-receive-pack>.

\--all:: \--all::
Instead of explicitly specifying which refs to update, Instead of explicitly specifying which refs to update,
update all refs that locally exist. update all refs that locally exist.

24
builtin-push.c

@ -8,10 +8,10 @@


#define MAX_URI (16) #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 int all, tags, force, thin = 1, verbose;
static const char *execute; static const char *receivepack;


#define BUF_SIZE (2084) #define BUF_SIZE (2084)
static char buffer[BUF_SIZE]; static char buffer[BUF_SIZE];
@ -160,10 +160,10 @@ static int get_remote_config(const char* key, const char* value)
add_refspec(xstrdup(value)); add_refspec(xstrdup(value));
else if (config_get_receivepack && else if (config_get_receivepack &&
!strcmp(key + 7 + config_repo_len, ".receivepack")) { !strcmp(key + 7 + config_repo_len, ".receivepack")) {
if (!execute) { if (!receivepack) {
char *ex = xmalloc(strlen(value) + 8); char *rp = xmalloc(strlen(value) + 16);
sprintf(ex, "--exec=%s", value); sprintf(rp, "--receive-pack=%s", value);
execute = ex; receivepack = rp;
} else } else
error("more than one receivepack given, using the first"); 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_current_uri = 0;
config_uri = uri; config_uri = uri;
config_get_refspecs = !(refspec_nr || all || tags); config_get_refspecs = !(refspec_nr || all || tags);
config_get_receivepack = (execute == NULL); config_get_receivepack = (receivepack == NULL);


git_config(get_remote_config); git_config(get_remote_config);
return config_current_uri; return config_current_uri;
@ -263,8 +263,8 @@ static int do_push(const char *repo)
argv[argc++] = "--all"; argv[argc++] = "--all";
if (force) if (force)
argv[argc++] = "--force"; argv[argc++] = "--force";
if (execute) if (receivepack)
argv[argc++] = execute; argv[argc++] = receivepack;
common_argc = argc; common_argc = argc;


for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
@ -347,8 +347,12 @@ int cmd_push(int argc, const char **argv, const char *prefix)
thin = 0; thin = 0;
continue; continue;
} }
if (!strncmp(arg, "--receive-pack=", 15)) {
receivepack = arg;
continue;
}
if (!strncmp(arg, "--exec=", 7)) { if (!strncmp(arg, "--exec=", 7)) {
execute = arg; receivepack = arg;
continue; continue;
} }
usage(push_usage); usage(push_usage);

12
send-pack.c

@ -6,9 +6,9 @@
#include "exec_cmd.h" #include "exec_cmd.h"


static const char send_pack_usage[] = 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."; " --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 verbose;
static int send_all; static int send_all;
static int force_update; static int force_update;
@ -377,8 +377,12 @@ int main(int argc, char **argv)
char *arg = *argv; char *arg = *argv;


if (*arg == '-') { if (*arg == '-') {
if (!strncmp(arg, "--receive-pack=", 15)) {
receivepack = arg + 15;
continue;
}
if (!strncmp(arg, "--exec=", 7)) { if (!strncmp(arg, "--exec=", 7)) {
exec = arg + 7; receivepack = arg + 7;
continue; continue;
} }
if (!strcmp(arg, "--all")) { if (!strcmp(arg, "--all")) {
@ -413,7 +417,7 @@ int main(int argc, char **argv)
usage(send_pack_usage); usage(send_pack_usage);
verify_remote_names(nr_heads, heads); verify_remote_names(nr_heads, heads);


pid = git_connect(fd, dest, exec); pid = git_connect(fd, dest, receivepack);
if (pid < 0) if (pid < 0)
return 1; return 1;
ret = send_pack(fd[0], fd[1], nr_heads, heads); ret = send_pack(fd[0], fd[1], nr_heads, heads);

Loading…
Cancel
Save