Skip to content

Commit 12201fd

Browse files
committed
Merge branch 'jk/bundle-progress'
Simplify UI to control progress meter given by "git bundle" command. * jk/bundle-progress: bundle: turn on --all-progress-implied by default
2 parents 3f3bb90 + 8b95521 commit 12201fd

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

Documentation/git-bundle.txt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-bundle - Move objects and refs by archive
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git bundle' create [-q | --quiet | --progress | --all-progress] [--all-progress-implied]
12+
'git bundle' create [-q | --quiet | --progress]
1313
[--version=<version>] <file> <git-rev-list-args>
1414
'git bundle' verify [-q | --quiet] <file>
1515
'git bundle' list-heads <file> [<refname>...]
@@ -115,22 +115,6 @@ unbundle <file>::
115115
is specified. This flag forces progress status even if
116116
the standard error stream is not directed to a terminal.
117117

118-
--all-progress::
119-
When --stdout is specified then progress report is
120-
displayed during the object count and compression phases
121-
but inhibited during the write-out phase. The reason is
122-
that in some cases the output stream is directly linked
123-
to another command which may wish to display progress
124-
status of its own as it processes incoming pack data.
125-
This flag is like --progress except that it forces progress
126-
report for the write-out phase as well even if --stdout is
127-
used.
128-
129-
--all-progress-implied::
130-
This is used to imply --all-progress whenever progress display
131-
is activated. Unlike --all-progress this flag doesn't actually
132-
force any progress display by itself.
133-
134118
--version=<version>::
135119
Specify the bundle version. Version 2 is the older format and can only be
136120
used with SHA-1 repositories; the newer version 3 contains capabilities that

builtin/bundle.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
#define BUILTIN_BUNDLE_CREATE_USAGE \
15-
N_("git bundle create [-q | --quiet | --progress | --all-progress] [--all-progress-implied]\n" \
15+
N_("git bundle create [-q | --quiet | --progress]\n" \
1616
" [--version=<version>] <file> <git-rev-list-args>")
1717
#define BUILTIN_BUNDLE_VERIFY_USAGE \
1818
N_("git bundle verify [-q | --quiet] <file>")
@@ -64,7 +64,7 @@ static int parse_options_cmd_bundle(int argc,
6464
}
6565

6666
static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
67-
int all_progress_implied = 0;
67+
int all_progress_implied = 1;
6868
int progress = isatty(STDERR_FILENO);
6969
struct strvec pack_opts;
7070
int version = -1;
@@ -74,11 +74,12 @@ static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
7474
N_("do not show progress meter"), 0),
7575
OPT_SET_INT(0, "progress", &progress,
7676
N_("show progress meter"), 1),
77-
OPT_SET_INT(0, "all-progress", &progress,
78-
N_("show progress meter during object writing phase"), 2),
79-
OPT_BOOL(0, "all-progress-implied",
80-
&all_progress_implied,
81-
N_("similar to --all-progress when progress meter is shown")),
77+
OPT_SET_INT_F(0, "all-progress", &progress,
78+
N_("historical; same as --progress"), 2,
79+
PARSE_OPT_HIDDEN),
80+
OPT_HIDDEN_BOOL(0, "all-progress-implied",
81+
&all_progress_implied,
82+
N_("historical; does nothing")),
8283
OPT_INTEGER(0, "version", &version,
8384
N_("specify bundle format version")),
8485
OPT_END()

t/t6020-bundle-misc.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1010

1111
. ./test-lib.sh
1212
. "$TEST_DIRECTORY"/lib-bundle.sh
13+
. "$TEST_DIRECTORY"/lib-terminal.sh
1314

1415
for cmd in create verify list-heads unbundle
1516
do
@@ -606,4 +607,16 @@ test_expect_success 'verify catches unreachable, broken prerequisites' '
606607
)
607608
'
608609

610+
test_expect_success 'bundle progress includes write phase' '
611+
GIT_PROGRESS_DELAY=0 \
612+
git bundle create --progress out.bundle --all 2>err &&
613+
grep 'Writing' err
614+
'
615+
616+
test_expect_success TTY 'create --quiet disables all bundle progress' '
617+
test_terminal env GIT_PROGRESS_DELAY=0 \
618+
git bundle create --quiet out.bundle --all 2>err &&
619+
test_must_be_empty err
620+
'
621+
609622
test_done

0 commit comments

Comments
 (0)