summaryrefslogtreecommitdiff
path: root/builtin/merge.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-02-20 09:53:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-02-21 18:24:08 (GMT)
commit99bfc6691d79eaffaaf170a8b6584bcfe97863dc (patch)
tree73ccfdfe22ca3affd0b7b9ab70e0c1697be1716b /builtin/merge.c
parent3ac942d42ebb1fb48e70d3e5a714d06396e3e2c6 (diff)
downloadgit-99bfc6691d79eaffaaf170a8b6584bcfe97863dc.zip
git-99bfc6691d79eaffaaf170a8b6584bcfe97863dc.tar.gz
git-99bfc6691d79eaffaaf170a8b6584bcfe97863dc.tar.bz2
merge: enable progress reporting for rename detection
The user can enable or disable it explicitly with the new --progress, but it defaults to checking isatty(2). This works only with merge-recursive and subtree. In theory we could pass a progress flag to other strategies, but none of them support progress at this point, so let's wait until they grow such a feature before worrying about propagating it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 42fff38..6ce8210 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -58,6 +58,7 @@ static int option_renormalize;
static int verbosity;
static int allow_rerere_auto;
static int abort_current_merge;
+static int show_progress = -1;
static struct strategy all_strategy[] = {
{ "recursive", DEFAULT_TWOHEAD | NO_TRIVIAL },
@@ -200,6 +201,7 @@ static struct option builtin_merge_options[] = {
OPT__VERBOSITY(&verbosity),
OPT_BOOLEAN(0, "abort", &abort_current_merge,
"abort the current in-progress merge"),
+ OPT_SET_INT(0, "progress", &show_progress, "force progress reporting", 1),
OPT_END()
};
@@ -659,6 +661,8 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
o.subtree_shift = "";
o.renormalize = option_renormalize;
+ o.show_rename_progress =
+ show_progress == -1 ? isatty(2) : show_progress;
for (x = 0; x < xopts_nr; x++)
if (parse_merge_opt(&o, xopts[x]))
@@ -944,6 +948,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, builtin_merge_options,
builtin_merge_usage, 0);
+ if (verbosity < 0 && show_progress == -1)
+ show_progress = 0;
+
if (abort_current_merge) {
int nargc = 2;
const char *nargv[] = {"reset", "--merge", NULL};