summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7a39741)
raw | patch | inline | side by side (parent: 7a39741)
author | Michael J Gruber <git@drmicha.warpmail.net> | |
Tue, 17 May 2011 15:38:53 +0000 (17:38 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 18 May 2011 04:01:29 +0000 (21:01 -0700) |
When trying to set a multivar with "git config var value", "git config"
issues
warning: remote.repoor.push has multiple values
leaving the user under the impression that the operation succeeded,
unless one checks the return value.
Instead, make it
warning: remote.repoor.push has multiple values
error: cannot overwrite multiple values with a single value
Use a regexp, --add or --set-all to change remote.repoor.push.
to be clear and helpful.
Note: The "warning" is raised through other code paths also so that it
needs to remain a warning for these (which do not raise the error). Only
the caller can determine how to go on from that.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
issues
warning: remote.repoor.push has multiple values
leaving the user under the impression that the operation succeeded,
unless one checks the return value.
Instead, make it
warning: remote.repoor.push has multiple values
error: cannot overwrite multiple values with a single value
Use a regexp, --add or --set-all to change remote.repoor.push.
to be clear and helpful.
Note: The "warning" is raised through other code paths also so that it
needs to remain a warning for these (which do not raise the error). Only
the caller can determine how to go on from that.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c | patch | blob | history |
diff --git a/builtin/config.c b/builtin/config.c
index 3e3c52849773348a568241f678b3e3ee2e8d123a..211e118d575411b712ccf0387db2408708576902 100644 (file)
--- a/builtin/config.c
+++ b/builtin/config.c
NULL, NULL);
}
else if (actions == ACTION_SET) {
+ int ret;
check_argc(argc, 2, 2);
value = normalize_value(argv[0], argv[1]);
- return git_config_set(argv[0], value);
+ ret = git_config_set(argv[0], value);
+ if (ret == CONFIG_NOTHING_SET)
+ error("cannot overwrite multiple values with a single value\n"
+ " Use a regexp, --add or --set-all to change %s.", argv[0]);
+ return ret;
}
else if (actions == ACTION_SET_ALL) {
check_argc(argc, 2, 3);