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: Junio C Hamano <junkio@cox.net>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH] make --exec=... option to git-push configurable
Date: Fri, 19 Jan 2007 13:46:16 +0100	[thread overview]
Message-ID: <20070119124616.GA3012@cepheus> (raw)
In-Reply-To: <20070119124300.GA2995@cepheus>

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

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(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index da7fde5..f1f409d 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -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.
diff --git a/builtin-push.c b/builtin-push.c
index ba7981f..6b3c03b 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -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;
-- 
1.5.0.rc1.g581a


-- 
Uwe Kleine-König

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

  reply	other threads:[~2007-01-19 12:46 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 ` Uwe Kleine-König [this message]
2007-01-19 12:49   ` [RFC PATCH] rename --exec to --receive-pack for " Uwe Kleine-König
2007-01-19 19:22 ` [PATCH] Update documentation of fetch-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=20070119124616.GA3012@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.