diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2005-11-17 22:32:36 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-11-19 20:47:29 -0800 |
commit | 10bea152a34b2bf1194ede5e0c9e5595ab2100f3 (patch) | |
tree | 64db26afffe676425fef2bace14d915fad87c381 /cache.h | |
parent | 0890098780f295f2a58658d1f6b6627e40426c72 (diff) | |
download | git-10bea152a34b2bf1194ede5e0c9e5595ab2100f3.tar.gz git-10bea152a34b2bf1194ede5e0c9e5595ab2100f3.tar.xz |
Add functions git_config_set() and git_config_set_multivar()
The function git_config_set() does exactly what you think it does.
Given a key (in the form "core.filemode") and a value, it sets the
key to the value. Example:
git_config_set("core.filemode", "true");
The function git_config_set_multivar() is meant for setting variables which
can have several values for the same key. Example:
[diff]
twohead = resolve
twohead = recarsive
the typo in the second line can be replaced by
git_config_set_multivar("diff.twohead", "recursive", "^recar");
The third argument of the function is a POSIX extended regex which has to
match the value. If there is no key/value pair with a matching value, a new
key/value pair is added.
These commands are also capable of unsetting (deleting) entries:
git_config_set_multivar("diff.twohead", NULL, "sol");
will delete the entry
twohead = resolve
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -386,6 +386,8 @@ extern int git_default_config(const char *, const char *); extern int git_config(config_fn_t fn); extern int git_config_int(const char *, const char *); extern int git_config_bool(const char *, const char *); +extern int git_config_set(const char *, const char *); +extern int git_config_set_multivar(const char *, const char *, const char *); #define MAX_GITNAME (1000) extern char git_default_email[MAX_GITNAME]; |