Re: [GSoC PATCH v2] backfill: auto-detect sparse-checkout from config
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 6, 2026, 16:27 UTC
- Message-ID
- <xmqqjyukcav6.fsf@gitster.g>
- In-Reply-To
- <e16edc29-a281-42f8-a712-4114d6a3288c@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 17 quoted lines
> On 4/4/26 7:15 AM, Trieu Huynh wrote:
>> From: Trieu Huynh <vikingtc4@gmail.com>
>>
>> Commit 85127bcdea ("backfill: assume --sparse when sparse-checkout is
>> enabled") intended for 'git backfill' to consult the repository
>> configuration when the user does not pass '--sparse' or
>> '--no-sparse' on the command line. It added the sentinel check:
>>
>> if (ctx->sparse < 0)
>> ctx->sparse = cfg->apply_sparse_checkout;
>>
>> However, the ctx->sparse field is initialized to 0 instead of -1,
>> so this guard never triggers. Consequently, the repository config
>> (core.sparseCheckout) is never checked, and the command always
>> performs a full backfill even when sparse-checkout is enabled.
>
> Thanks for adding this context. This patch LGTM.Yup, thanks, both of you. The original patch without this explanation may not be so obvious but after taking a look at what that commit did, it is very clear what went wrong.