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

[PATCH 2/3] Add git-config-set, a simple helper for scripts to set config variables

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 15, 2005, 21:36 UTC
Message-ID
<Pine.LNX.4.63.0511152236200.2152@wbgn013.biozentrum.uni-wuerzburg.de>

This is meant for the end user, who cannot be expected to edit .git/config by hand.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 Makefile     |    3 ++-
 config-set.c |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletions(-)
 create mode 100644 config-set.c

applies-to: 182b0cedc3aa9a6d4afb3331a9c9472306cf77c6 ef6b137c5b90c3d0cba100d39b0fd7ed9de0dad8

diff --git a/Makefile b/Makefile
index d20cf66..55f4d44 100644
--- a/Makefile
+++ b/Makefile
@@ -125,7 +125,8 @@ PROGRAMS = \
 	git-unpack-objects$X git-update-index$X git-update-server-info$X \
 	git-upload-pack$X git-verify-pack$X git-write-tree$X \
 	git-update-ref$X git-symbolic-ref$X git-check-ref-format$X \
-	git-name-rev$X git-pack-redundant$X $(SIMPLE_PROGRAMS)
+	git-name-rev$X git-pack-redundant$X git-config-set$X \
+	$(SIMPLE_PROGRAMS)
 
 # Backward compatibility -- to be removed after 1.0
 PROGRAMS += git-ssh-pull$X git-ssh-push$X
diff --git a/config-set.c b/config-set.c
new file mode 100644
index 0000000..fe024da
--- /dev/null
+++ b/config-set.c
@@ -0,0 +1,16 @@
+#include "cache.h"
+
+static const char git_config_set_usage[] =
+"git-config-set name value";
+
+int main(int argc, const char **argv)
+{
+	setup_git_directory();
+	switch (argc) {
+	case 3:
+		return git_config_set(argv[1], argv[2]);
+	default:
+		usage(git_config_set_usage);
+	}
+	return 0;
+}
---
0.99.9.GIT
Message 1 of 1 in “Add git-config-set, a simple helper for scripts to set config variables”
  1. 2/3 Add git-config-set, a simple helper for scripts to set config variablesJohannes Schindelin, Nov 15, 2005

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.