git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH RFC] new config option remote.<name>.pushexec

From
Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
Date
Jan 16, 2007, 15:02 UTC
Message-ID
<20070116150259.GA2439@cepheus>

git push --exec=... is fine, but having it to specify every time is annoying.

This sets the default remote program for pushing to remote <name>.
Signed-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
---
This has (still) a few short comings:
 a) compiler warning because execute has the type const char*.
 b) cmdline should overwrite remote.<name>.pushexec w/o the warning.
 c) the symmetric part for fetch is missing.
The idea should be clear.  Would a more complete patch be welcome?

Best regards Uwe

 Documentation/config.txt |    4 ++++
 builtin-push.c           |    7 +++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index faa17ba..667628a 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -351,6 +351,10 @@ remote.<name>.push::
 	The default set of "refspec" for gitlink:git-push[1]. See
 	gitlink:git-push[1].
 
+remote.<name>.pushexec::
+	The default program to execute on the remote side.  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 7a3d2bb..8ea5dea 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -157,6 +157,13 @@ 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 (!strcmp(key + 7 + config_repo_len, ".pushexec")) {
+			if (!execute) {
+				execute = xmalloc(strlen(value) + 8);
+				sprintf(execute, "--exec=%s", value);
+			} else
+				error("more than one pushexec given");
+		}
 	}
 	return 0;
 }
-- 
1.5.0.rc1.g581a


-- 
Uwe Kleine-König

http://www.google.com/search?q=5+choose+3
Next: Johannes Schindelin
Message 1 of 19 in “new config option remote.<name>.pushexec”
  1. new config option remote.<name>.pushexecUwe Kleine-König, Jan 16, 2007
  2. Johannes SchindelinJan 16, 2007
  3. Uwe Kleine-KönigJan 16, 2007
  4. How to merge FETCH_HEAD?Michael S. Tsirkin, Jan 16, 2007
  5. Shawn O. PearceJan 16, 2007
  6. Michael S. TsirkinJan 16, 2007
  7. Johannes SchindelinJan 16, 2007
  8. Michael S. TsirkinJan 17, 2007
  9. Junio C HamanoJan 17, 2007
  10. Michael S. TsirkinJan 17, 2007
  11. Junio C HamanoJan 16, 2007
  12. Shawn O. PearceJan 16, 2007
  13. Johannes SchindelinJan 16, 2007
  14. Uwe Kleine-KönigJan 17, 2007
  15. Junio C HamanoJan 17, 2007
  16. Uwe Kleine-KönigJan 18, 2007
  17. make --upload-pack option to git-fetch configurableUwe Kleine-König, Jan 25, 2007
  18. Uwe Kleine-KönigJan 25, 2007
  19. Brian GernhardtJan 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.