Re: [PATCH 10/11] pack-bitmap-write.c: don't return without stop_progress()
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Oct 21, 2021, 11:31 UTC
- Message-ID
- <211021.86ee8emx57.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <cb30aa67c0023c435cf472303bbf4894c8b2d7ec.1634787555.git.me@ttaylorr.com>
On Wed, Oct 20 2021, Taylor Blau wrote:
Show 42 quoted lines
> From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>
> Fix a bug that's been here since 7cc8f971085 (pack-objects: implement
> bitmap writing, 2013-12-21), we did not call stop_progress() if we
> reached the early exit in this function.
>
> We could call stop_progress() before we return, but better yet is to
> defer calling start_progress() until we need it.
>
> This will matter in a subsequent commit where we BUG(...) out if this
> happens, and matters now e.g. because we don't have a corresponding
> "region_end" for the progress trace2 event.
>
> Suggested-by: SZEDER Gábor <szeder.dev@gmail.com>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> Signed-off-by: Taylor Blau <me@ttaylorr.com>
> ---
> pack-bitmap-write.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
> index 9c55c1531e..cab3eaa2ac 100644
> --- a/pack-bitmap-write.c
> +++ b/pack-bitmap-write.c
> @@ -575,15 +575,15 @@ void bitmap_writer_select_commits(struct commit **indexed_commits,
>
> QSORT(indexed_commits, indexed_commits_nr, date_compare);
>
> - if (writer.show_progress)
> - writer.progress = start_progress("Selecting bitmap commits", 0);
> -
> if (indexed_commits_nr < 100) {
> for (i = 0; i < indexed_commits_nr; ++i)
> push_bitmapped_commit(indexed_commits[i]);
> return;
> }
>
> + if (writer.show_progress)
> + writer.progress = start_progress("Selecting bitmap commits", 0);
> +
> for (;;) {
> struct commit *chosen = NULL;Looks good :) Just a note that this is in "ab/only-single-progress-at-once" already in case you didn't spot it.
That series is marked for "next?" (with a question mark) by Junio in the latest what's cooking, so *hint* *hint* for any last minute review :)