Re: [PATCH 2/2] read-cache: fix incorrect count and progress bar stalling
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 7, 2021, 23:41 UTC
- Message-ID
- <xmqqczsxtf8g.fsf@gitster.g>
- In-Reply-To
- <8735tt4fhx.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 17 quoted lines
>> So I think this pattern works:
>>
>> for (i = 0; i < nr; i++) {
>> display_progress(p, i);
>> /* work work work */
>> }
>> display_progress(p, nr);
>>
>> Alternatively, if the work part doesn't contain continue statements:
>>
>> for (i = 0; i < nr; i++) {
>> /* work work work */
>> display_progress(p, i + 1);
>> }
>
> But yes, I agree with the issue in theory, but I think in practice we
> don't need to worry about these 100% cases.Hmph, but in practice we do need to worry, don't we? Otherwise you wouldn't have started this thread and René wouldn't have responded.
I agree with the issue and I think we should count what we have finished.