Message ID | ZAMjkffYmp+DNmr+@coredump.intra.peff.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [RFC/PATCH] bundle: turn on --all-progress-implied by default | expand |
On Sat, Mar 04, 2023 at 05:55:13AM -0500, Jeff King wrote: ... > I'm marking it as "RFC" because it's undoing some of what Robin (cc'd) > did in the commit referenced below. But I remain unconvinced that it's a > useful direction. > -- >8 -- > Subject: bundle: turn on --all-progress-implied by default (snip) Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> +1 to at least roll it into a RC. IIRC this was a mechanical mapping to expose the pack options into the bundle command; and a cleanup is worthwhile. (snip) > diff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh > index 7d40994991e..978c5b17ba5 100755 > --- a/t/t6020-bundle-misc.sh > +++ b/t/t6020-bundle-misc.sh > @@ -606,4 +606,10 @@ test_expect_success 'verify catches unreachable, broken prerequisites' ' > ) > ' > > +test_expect_success 'bundle progress includes write phase' ' > + GIT_PROGRESS_DELAY=0 \ > + git bundle create --progress out.bundle --all 2>err && > + grep 'Writing' err > +' > + > test_done Suggestion: How about adding a test for --quiet that ensures no other output?
On Mon, Mar 06, 2023 at 03:44:11AM +0000, Robin H. Johnson wrote: > > diff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh > > index 7d40994991e..978c5b17ba5 100755 > > --- a/t/t6020-bundle-misc.sh > > +++ b/t/t6020-bundle-misc.sh > > @@ -606,4 +606,10 @@ test_expect_success 'verify catches unreachable, broken prerequisites' ' > > ) > > ' > > > > +test_expect_success 'bundle progress includes write phase' ' > > + GIT_PROGRESS_DELAY=0 \ > > + git bundle create --progress out.bundle --all 2>err && > > + grep 'Writing' err > > +' > > + > > test_done > > Suggestion: How about adding a test for --quiet that ensures no other > output? I had sort of assumed that we had those already, from the earlier work, but it looks like we don't. Squashing this in would do it, I think (we need test_terminal since otherwise we'd be quiet anyway): diff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh index 978c5b17ba5..7bbb351b7be 100755 --- a/t/t6020-bundle-misc.sh +++ b/t/t6020-bundle-misc.sh @@ -10,6 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh . "$TEST_DIRECTORY"/lib-bundle.sh +. "$TEST_DIRECTORY"/lib-terminal.sh for cmd in create verify list-heads unbundle do @@ -612,4 +613,10 @@ test_expect_success 'bundle progress includes write phase' ' grep 'Writing' err ' +test_expect_success TTY '--quiet disables all bundle progress' ' + test_terminal env GIT_PROGRESS_DELAY=0 \ + git bundle --quiet create out.bundle --all 2>err && + test_must_be_empty err +' + test_done
On Mon, Mar 06, 2023 at 12:38:38AM -0500, Jeff King wrote: > @@ -612,4 +613,10 @@ test_expect_success 'bundle progress includes write phase' ' > grep 'Writing' err > ' > > +test_expect_success TTY '--quiet disables all bundle progress' ' > + test_terminal env GIT_PROGRESS_DELAY=0 \ > + git bundle --quiet create out.bundle --all 2>err && > + test_must_be_empty err > +' Err, this should be "create --quiet", of course, not the other way around. I did run it before sending, but I removed the "--quiet" to double-check that it generates progress with test_terminal. But then added it back in to the wrong spot. :-/ -Peff
Jeff King <peff@peff.net> writes: > I'm actually kind of confused about what happened with 79862b6b77c. If > you go to the subthread linked above, you can see that I made similar > arguments there, and Junio seemed to agree. Then the next thing I could > find is the series appearing in What's cooking: > > https://lore.kernel.org/git/xmqqftikxs4z.fsf@gitster-ct.c.googlers.com/ > > marked as "will merge to master". Is there more discussion I couldn't > find? Was it accidentally graduated? I am stumped as well X-<. It does look like it was merged down by accident. Sorry for the confusion.
diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 18a022b4b40..a4227b6561d 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -9,7 +9,7 @@ git-bundle - Move objects and refs by archive SYNOPSIS -------- [verse] -'git bundle' create [-q | --quiet | --progress | --all-progress] [--all-progress-implied] +'git bundle' create [-q | --quiet | --progress] [--version=<version>] <file> <git-rev-list-args> 'git bundle' verify [-q | --quiet] <file> 'git bundle' list-heads <file> [<refname>...] @@ -115,22 +115,6 @@ unbundle <file>:: is specified. This flag forces progress status even if the standard error stream is not directed to a terminal. ---all-progress:: - When --stdout is specified then progress report is - displayed during the object count and compression phases - but inhibited during the write-out phase. The reason is - that in some cases the output stream is directly linked - to another command which may wish to display progress - status of its own as it processes incoming pack data. - This flag is like --progress except that it forces progress - report for the write-out phase as well even if --stdout is - used. - ---all-progress-implied:: - This is used to imply --all-progress whenever progress display - is activated. Unlike --all-progress this flag doesn't actually - force any progress display by itself. - --version=<version>:: Specify the bundle version. Version 2 is the older format and can only be used with SHA-1 repositories; the newer version 3 contains capabilities that diff --git a/builtin/bundle.c b/builtin/bundle.c index acceef62001..c2b916e027a 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -12,7 +12,7 @@ */ #define BUILTIN_BUNDLE_CREATE_USAGE \ - N_("git bundle create [-q | --quiet | --progress | --all-progress] [--all-progress-implied]\n" \ + N_("git bundle create [-q | --quiet | --progress]\n" \ " [--version=<version>] <file> <git-rev-list-args>") #define BUILTIN_BUNDLE_VERIFY_USAGE \ N_("git bundle verify [-q | --quiet] <file>") @@ -64,7 +64,7 @@ static int parse_options_cmd_bundle(int argc, } static int cmd_bundle_create(int argc, const char **argv, const char *prefix) { - int all_progress_implied = 0; + int all_progress_implied = 1; int progress = isatty(STDERR_FILENO); struct strvec pack_opts; int version = -1; @@ -74,11 +74,12 @@ static int cmd_bundle_create(int argc, const char **argv, const char *prefix) { N_("do not show progress meter"), 0), OPT_SET_INT(0, "progress", &progress, N_("show progress meter"), 1), - OPT_SET_INT(0, "all-progress", &progress, - N_("show progress meter during object writing phase"), 2), - OPT_BOOL(0, "all-progress-implied", - &all_progress_implied, - N_("similar to --all-progress when progress meter is shown")), + OPT_SET_INT_F(0, "all-progress", &progress, + N_("historical; same as --progress"), 2, + PARSE_OPT_HIDDEN), + OPT_HIDDEN_BOOL(0, "all-progress-implied", + &all_progress_implied, + N_("historical; does nothing")), OPT_INTEGER(0, "version", &version, N_("specify bundle format version")), OPT_END() diff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh index 7d40994991e..978c5b17ba5 100755 --- a/t/t6020-bundle-misc.sh +++ b/t/t6020-bundle-misc.sh @@ -606,4 +606,10 @@ test_expect_success 'verify catches unreachable, broken prerequisites' ' ) ' +test_expect_success 'bundle progress includes write phase' ' + GIT_PROGRESS_DELAY=0 \ + git bundle create --progress out.bundle --all 2>err && + grep 'Writing' err +' + test_done