Re: [GSoC PATCH v2] backfill: add --[no-]progress option
- From
Tian Yuchen <cat@malon.dev>
- Date
- Apr 15, 2026, 17:04 UTC
- Message-ID
- <21c10a52-82f4-4aa0-9027-21bb660b54cc@malon.dev>
- In-Reply-To
- <20260412193659.26288-1-viking4@gmail.com>
On 4/13/26 03:36, Trieu Huynh wrote:
Show 7 quoted lines
> @@ -133,6 +133,30 @@ test_expect_success 'do partial clone 2, backfill min batch size' ' > test_line_count = 0 revs2 > ' > > +test_expect_success TTY 'backfill shows progress on tty by default' ' > + git clone --no-checkout --filter=blob:none \ > + --single-branch --branch=main \
[1]
Show 8 quoted lines
> + "file://$(pwd)/srv.bare" clone-tty && > + test_terminal env GIT_PROGRESS_DELAY=0 git -C clone-tty backfill 2>err && > + test_grep "Downloading missing blobs" err > +' > + > +test_expect_success 'backfill --progress shows progress' ' > + git clone --no-checkout --filter=blob:none \ > + --single-branch --branch=main \
[1]
Show 8 quoted lines
> + "file://$(pwd)/srv.bare" clone-progress && > + git -C clone-progress backfill --progress 2>err && > + test_grep "Downloading missing blobs" err > +' > + > +test_expect_success 'backfill --no-progress suppresses progress' ' > + git clone --no-checkout --filter=blob:none \ > + --single-branch --branch=main \
[1]
> + "file://$(pwd)/srv.bare" clone-no-progress && > + git -C clone-no-progress backfill --no-progress 2>err && > + test_grep ! "Downloading missing blobs" err
[2]
Show 5 quoted lines
> +' > + > test_expect_success 'backfill --sparse without sparse-checkout fails' ' > git init not-sparse && > test_must_fail git -C not-sparse backfill --sparse 2>err &&
[1] I reckon you can reuse the git-cloned repository; there’s no need to clone in every test. It's up to you ;-)
[2] You mentioned that you want test script to verify that '--no-progress suppresses output', but are you referring to the output brought by the '--progress' parameter itself, or *all* output?
I believe the second scenario is a bit more meaningful. If that is the case, then the matching condition 'Downloading missing blobs' is clearly a necessary but insufficient condition. The output from the internal call to 'git fetch' within 'git backfill' will not be matched, which results in a false negative.
Regards, Yuchen