From 27b30be686e497e6ab84dc0b25623df7aba1ba2c Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 28 Feb 2016 11:54:35 +0000 Subject: config: fail if --get-urlmatch finds no value The --get, --get-all and --get-regexp options to git-config exit with status 1 if the key is not found but --get-urlmatch succeeds in this case. Change --get-urlmatch to behave in the same way as the other --get* options so that all four are consistent. --get-color is a special case because it accepts a default value to return and so should not return an error if the key is not found. Also clarify this behaviour in the documentation. Signed-off-by: John Keeping Signed-off-by: Junio C Hamano --- Documentation/git-config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/git-config.txt') diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index 2608ca74ac..b96149495a 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -102,7 +102,7 @@ OPTIONS given URL is returned (if no such key exists, the value for section.key is used as a fallback). When given just the section as name, do so for all the keys in the section and - list them. + list them. Returns error code 1 if no value is found. --global:: For writing options: write to global `~/.gitconfig` file -- cgit v1.2.1 From 94c5b0e8b9276416a01646d1e4fdb73561323558 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 28 Feb 2016 11:54:36 +0000 Subject: Documentation/git-config: use bulleted list for exit codes Using a numbered list is confusing because the exit codes are not listed in order so the numbers at the start of each line do not match the exit codes described by the following text. Switch to a bulleted list so that the only number appearing on each line is the exit code described. Signed-off-by: John Keeping Signed-off-by: Junio C Hamano --- Documentation/git-config.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Documentation/git-config.txt') diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index b96149495a..6a7250785e 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -58,13 +58,13 @@ that location (you can say '--local' but that is the default). This command will fail with non-zero status upon error. Some exit codes are: -. The config file is invalid (ret=3), -. can not write to the config file (ret=4), -. no section or name was provided (ret=2), -. the section or key is invalid (ret=1), -. you try to unset an option which does not exist (ret=5), -. you try to unset/set an option for which multiple lines match (ret=5), or -. you try to use an invalid regexp (ret=6). +- The config file is invalid (ret=3), +- can not write to the config file (ret=4), +- no section or name was provided (ret=2), +- the section or key is invalid (ret=1), +- you try to unset an option which does not exist (ret=5), +- you try to unset/set an option for which multiple lines match (ret=5), or +- you try to use an invalid regexp (ret=6). On success, the command returns the exit code 0. -- cgit v1.2.1 From 24990b2febec5e00ecc8c7c57614b7431b86f7a5 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 28 Feb 2016 11:54:37 +0000 Subject: Documentation/git-config: fix --get-all description --get does not fail if a key is multi-valued, it returns the last value as described in its documentation. Clarify the description of --get-all to avoid implying that --get does fail in this case. Signed-off-by: John Keeping Signed-off-by: Junio C Hamano --- Documentation/git-config.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Documentation/git-config.txt') diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index 6a7250785e..409df406fa 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -86,8 +86,7 @@ OPTIONS found and the last value if multiple key values were found. --get-all:: - Like get, but does not fail if the number of values for the key - is not exactly one. + Like get, but returns all values for a multi-valued key. --get-regexp:: Like --get-all, but interprets the name as a regular expression and -- cgit v1.2.1