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

From: Junio C Hamano <[email-masked]>
Date: Mon, 06 Apr 2026 10:35:58 -0700

Derrick Stolee <[email-masked]> writes:

> On 3/29/2026 11:24 AM, Trieu Huynh wrote:
>> 'git backfill' is silent when downloading missing objects, giving
>> no feedback during potentially long-running operations on large
>> repositories. By contrast, 'git fetch', 'git gc', and
>> 'git index-pack' all support --[no-]progress.
>
> I wouldn't use the word "silent" because the output is actually
> quite verbose by default.

;-)

> With your patch, I think there would be some extra progress
> indicators between these batched fetch requests.

>>  static void backfill_context_clear(struct backfill_context *ctx)
>> @@ -54,6 +57,7 @@ static void download_batch(struct backfill_context *ctx)
>>  	 * avoid possible duplicate downloads of the same objects.
>>  	 */
>>  	odb_reprepare(ctx->repo->objects);
>> +	display_progress(ctx->progress, ++ctx->batches_requested);
>
> This looks correct. My preference is to not use prefix operators
> like this on struct members (it reads like you are incrementing
> 'ctx' and not 'batches_requested', even though it is correct).

Thanks for paying extra attention to such details.  In general,
post-increment and pre-decrement are the norm when evaluated in a
void context, so the use of pre-increment above violates that norm
too.

> However, I'm not sure that we want the progress to indicate the
> number of _batches_ but instead should be the number of _objects_.

True, too.

Thanks.