diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2005-11-20 13:24:18 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-11-20 19:53:06 +0100 |
commit | f98d863d2122e1b8781dfb9889df98876a26f315 (patch) | |
tree | 3b688c9ff010bd74cde0027fe63f1d225a53b0ab /Documentation | |
parent | merge-recursive: Replace 'except:' (diff) | |
download | git-f98d863d2122e1b8781dfb9889df98876a26f315.tar.xz git-f98d863d2122e1b8781dfb9889df98876a26f315.zip |
git-config-set: support selecting values by non-matching regex
Extend the regex syntax of value_regex so that prepending an exclamation
mark means non-match:
[core]
quetzal = "Dodo" for Brainf*ck
quetzal = "T. Rex" for Malbolge
quetzal = "cat"
You can match the third line with
git-config-set --get quetzal '! for '
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-config-set.txt | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Documentation/git-config-set.txt b/Documentation/git-config-set.txt index c707fbcf99..bfbd42147a 100644 --- a/Documentation/git-config-set.txt +++ b/Documentation/git-config-set.txt @@ -22,7 +22,9 @@ actually the section and the key separated by a dot, and the value will be escaped. If you want to set/unset an option which can occor on multiple lines, you -should provide a POSIX regex for the value. +should provide a POSIX regex for the value. If you want to handle the lines +*not* matching the regex, just prepend a single exlamation mark in front +(see EXAMPLES). This command will fail if @@ -82,6 +84,7 @@ Given a .git/config like this: command="ssh" for "ssh://kernel.org/" command="proxy-command" for kernel.org command="myprotocol-command" for "my://" + command=default-proxy ; for all the rest you can set the filemode to true with @@ -139,6 +142,19 @@ new one with % git config-set --replace-all proxy.command ssh ------------ +However, if you really only want to replace the line for the default proxy, +i.e. the one without a "for ..." postfix, do something like this: + +------------ +% git config-set proxy.command ssh '! for ' +------------ + +To actually match only values with an exclamation mark, you have to + +------------ +% git config-set section.key value '[!]' +------------ + Author ------ |