summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3ac942d)
raw | patch | inline | side by side (parent: 3ac942d)
author | Jeff King <peff@peff.net> | |
Sun, 20 Feb 2011 09:53:21 +0000 (04:53 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Feb 2011 18:24:08 +0000 (10:24 -0800) |
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>
--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>
Documentation/merge-options.txt | patch | blob | history | |
builtin/merge.c | patch | blob | history | |
merge-recursive.c | patch | blob | history | |
merge-recursive.h | patch | blob | history |
index e33e0f8e110879a0cd6fe81d97ee6044290e5cfa..b613d4ed083d080797f7da90fc92212f98611d07 100644 (file)
ifndef::git-pull[]
-q::
--quiet::
- Operate quietly.
+ Operate quietly. Implies --no-progress.
-v::
--verbose::
Be verbose.
+
+--progress::
+--no-progress::
+ Turn progress on/off explicitly. If neither is specified,
+ progress is shown if standard error is connected to a terminal.
+ Note that not all merge strategies may support progress
+ reporting.
+
endif::git-pull[]
diff --git a/builtin/merge.c b/builtin/merge.c
index 42fff387e69d9b5412e8e776aed3272b78ebe758..6ce82105017a656609735805586566a638f4785c 100644 (file)
--- a/builtin/merge.c
+++ b/builtin/merge.c
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 },
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()
};
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]))
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};
diff --git a/merge-recursive.c b/merge-recursive.c
index 089aa10cc1df7e8ad129471ed1b027843d057800..6c8f95771231e0b0d5400e6c4b9af17fffeedbe7 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
o->diff_rename_limit >= 0 ? o->diff_rename_limit :
1000;
opts.rename_score = o->rename_score;
+ opts.show_rename_progress = o->show_rename_progress;
opts.output_format = DIFF_FORMAT_NO_OUTPUT;
if (diff_setup_done(&opts) < 0)
die("diff setup failed");
diff --git a/merge-recursive.h b/merge-recursive.h
index f0e056652f47e3e31d2d084f98b6a6b9751ad22c..59d1475be9239c57190620ed8c4df628dd24d4f8 100644 (file)
--- a/merge-recursive.h
+++ b/merge-recursive.h
int merge_rename_limit;
int rename_score;
int needed_rename_limit;
+ int show_rename_progress;
int call_depth;
struct strbuf obuf;
struct string_list current_file_set;