merge: pass verbosity flag down to merge-recursive
authorJeff King <peff@peff.net>
Thu, 2 Apr 2015 21:39:52 +0000 (17:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Apr 2015 22:12:39 +0000 (15:12 -0700)
This makes "git merge --quiet" really quiet when we call
into merge-recursive.

Note that we can't just pass our flag down as-is; the two
parts of the code use different scales. We center at "0" as
normal for git-merge (with "--quiet" giving a negative
value), but merge-recursive uses "2" as its center. This
patch passes a negative value to merge-recursive rather than
"1", though, as otherwise the user would have to use "-qqq"
to squelch all messages (but the downside is that the user
cannot distinguish between levels 0-2 if without resorting
to the GIT_MERGE_VERBOSITY variable).

We may want to review and renormalize the message severities
in merge-recursive, but that does not have to happen now.
This is at least in improvement in the sense that we are
respecting "--quiet" at all.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c
index 8763b2efa2d7e3d7af49e9bc160a67239fbd3147..4b200b5b95b462496befe2a67f48c39a34b51edc 100644 (file)
@@ -687,6 +687,10 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
                        o.subtree_shift = "";
 
                o.renormalize = option_renormalize;
+               if (verbosity < 0)
+                       o.verbosity = verbosity;
+               else if (verbosity > 0)
+                       o.verbosity += verbosity;
                o.show_rename_progress =
                        show_progress == -1 ? isatty(2) : show_progress;