diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-23 14:13:07 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-23 14:13:07 -0700 |
commit | ad7d3c3b391b73207fbb29da99d4f64ad0c54f00 (patch) | |
tree | afdf7e3fd01cdb0d8a1451c46ff1c19fb9ec8de1 /builtin | |
parent | 75010153e95f2b340f841953e3a0ce269ccf394f (diff) | |
parent | 9eaa858eb90802b9b6ce8a061229faba463f4bc3 (diff) | |
download | git-ad7d3c3b391b73207fbb29da99d4f64ad0c54f00.tar.gz git-ad7d3c3b391b73207fbb29da99d4f64ad0c54f00.tar.xz |
Merge branch 'kw/rebase-progress'
"git rebase", especially when it is run by mistake and ends up
trying to replay many changes, spent long time in silence. The
command has been taught to show progress report when it spends
long time preparing these many changes to replay (which would give
the user a chance to abort with ^C).
* kw/rebase-progress:
rebase: turn on progress option by default for format-patch
format-patch: have progress option while generating patches
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/log.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin/log.c b/builtin/log.c index 25c824109..25c080840 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -27,6 +27,7 @@ #include "version.h" #include "mailmap.h" #include "gpg-interface.h" +#include "progress.h" /* Set a default date-time format for git log ("log.date" config variable) */ static const char *default_date_mode = NULL; @@ -1422,6 +1423,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) char *branch_name = NULL; char *base_commit = NULL; struct base_tree_info bases; + int show_progress = 0; + struct progress *progress = NULL; const struct option builtin_format_patch_options[] = { { OPTION_CALLBACK, 'n', "numbered", &numbered, NULL, @@ -1493,6 +1496,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) OPT_FILENAME(0, "signature-file", &signature_file, N_("add a signature from a file")), OPT__QUIET(&quiet, N_("don't print the patch filenames")), + OPT_BOOL(0, "progress", &show_progress, + N_("show progress while generating patches")), OPT_END() }; @@ -1752,8 +1757,12 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) start_number--; } rev.add_signoff = do_signoff; + + if (show_progress) + progress = start_progress_delay(_("Generating patches"), total, 0, 2); while (0 <= --nr) { int shown; + display_progress(progress, total - nr); commit = list[nr]; rev.nr = total - nr + (start_number - 1); /* Make the second and subsequent mails replies to the first */ @@ -1818,6 +1827,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (!use_stdout) fclose(rev.diffopt.file); } + stop_progress(&progress); free(list); free(branch_name); string_list_clear(&extra_to, 0); |