summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 10bea15)
raw | patch | inline | side by side (parent: 10bea15)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Thu, 17 Nov 2005 21:44:55 +0000 (22:44 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 20 Nov 2005 04:47:29 +0000 (20:47 -0800) |
This is meant for the end user, who cannot be expected to edit
.git/config by hand.
Example:
git-config-set core.filemode true
will set filemode in the section [core] to true,
git-config-set --unset core.filemode
will remove the entry (failing if it is not there), and
git-config-set --unset diff.twohead ^recar
will remove the unique entry whose value matches the regex "^recar"
(failing if there is no unique such entry).
It is just a light wrapper around git_config_set() and
git_config_set_multivar().
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
.git/config by hand.
Example:
git-config-set core.filemode true
will set filemode in the section [core] to true,
git-config-set --unset core.filemode
will remove the entry (failing if it is not there), and
git-config-set --unset diff.twohead ^recar
will remove the unique entry whose value matches the regex "^recar"
(failing if there is no unique such entry).
It is just a light wrapper around git_config_set() and
git_config_set_multivar().
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
.gitignore | patch | blob | history | |
Makefile | patch | blob | history | |
config-set.c | [new file with mode: 0644] | patch | blob |
diff --git a/.gitignore b/.gitignore
index 0dd7b9c7b4ab6f02fc0b73d0c92cd2520bfa032f..d17a8b5845fdb792b55bf4d24597bc7f109eae52 100644 (file)
--- a/.gitignore
+++ b/.gitignore
git-clone-pack
git-commit
git-commit-tree
+git-config-set
git-convert-objects
git-count-objects
git-cvsexportcommit
diff --git a/Makefile b/Makefile
index 0efb0b65654de91e2e2308343b4c9d4e58711d88..092931a1f1ab5874562a056ae8ba82afd69840aa 100644 (file)
--- a/Makefile
+++ b/Makefile
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 git-var$X $(SIMPLE_PROGRAMS)
+ git-name-rev$X git-pack-redundant$X git-config-set$X git-var$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
--- /dev/null
+++ b/config-set.c
@@ -0,0 +1,26 @@
+#include "cache.h"
+
+static const char git_config_set_usage[] =
+"git-config-set name [value [value_regex]] | --unset name [value_regex]";
+
+int main(int argc, const char **argv)
+{
+ setup_git_directory();
+ switch (argc) {
+ case 2:
+ return git_config_set(argv[1], NULL);
+ case 3:
+ if (!strcmp(argv[1], "--unset"))
+ return git_config_set(argv[2], NULL);
+ else
+ return git_config_set(argv[1], argv[2]);
+ case 4:
+ if (!strcmp(argv[1], "--unset"))
+ return git_config_set_multivar(argv[2], NULL, argv[3]);
+ else
+ return git_config_set_multivar(argv[1], argv[2], argv[3]);
+ default:
+ usage(git_config_set_usage);
+ }
+ return 0;
+}