summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 18bd882)
raw | patch | inline | side by side (parent: 18bd882)
author | Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de> | |
Fri, 19 Jan 2007 12:46:16 +0000 (13:46 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 20 Jan 2007 01:54:33 +0000 (17:54 -0800) |
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").
Signed-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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").
Signed-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/config.txt | patch | blob | history | |
builtin-push.c | patch | blob | history |
index da7fde56b4bd51e62434c5b5b82ce7253dac831b..f1f409d24b518a0e98865d94319735160bb9555b 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
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.
diff --git a/builtin-push.c b/builtin-push.c
index ba7981f5bf5c165aefe5c90d5fcb9baa76baebdd..6b3c03b8a6b8bb4c33acf6260a6d086da74b1002 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
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)
{
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;
}
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;