Subject: Re: [GSoC PATCH v2] backfill: add --[no-]progress option

From: Tian Yuchen <[email-masked]>
Date: Thu, 16 Apr 2026 01:04:58 +0800

On 4/13/26 03:36, Trieu Huynh wrote:
> @@ -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]

> +		"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]

> +		"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]

> +'
> +
>   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