git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] commit-graph: increment progress indicator

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 12, 2024, 08:26 UTC
Message-ID
<515d055e-a785-6d25-237d-bdfe06a2a69c@gmx.de>
In-Reply-To
<ZmlK59HYWY_aXgv5@tanuki>
Hi Patrick,
On Wed, 12 Jun 2024, Patrick Steinhardt wrote:
Show 37 quoted lines
> On Tue, Jun 11, 2024 at 03:09:15PM +0000, Johannes Schindelin via GitGitGadget wrote:
> > From: Derrick Stolee <derrickstolee@github.com>
> >
> > This fixes a bug that was introduced by 368d19b0b7 (commit-graph:
> > refactor compute_topological_levels(), 2023-03-20): Previously, the
> > progress indicator was updated from `i + 1` where `i` is the loop
> > variable of the enclosing `for` loop. After this patch, the update used
> > `info->progress_cnt + 1` instead, however, unlike `i`, the
> > `progress_cnt` attribute was not incremented. Let's increment it.
> >
> > [...]
>
> The fix looks obviously correct. Do we also want to amend tests? We have
> e.g. "t6500-gc.sh", "gc --no-quiet", where we already grep for the
> progress report without verifying numbers. The output there is:
>
>     Computing commit graph topological levels:  25% (1/4), done.
>     Computing commit graph generation numbers:  25% (1/4), done.
>
> , which clearly demonstrates the bug for both callsites of the buggy
> function.
>
> The following change would thus detect such regressions in the future:
>
>     diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
>     index 43d40175f8..1b5909d1b7 100755
>     --- a/t/t6500-gc.sh
>     +++ b/t/t6500-gc.sh
>     @@ -158,7 +158,7 @@ test_expect_success TTY 'with TTY: gc --no-quiet' '
>             git -c gc.writeCommitGraph=true gc --no-quiet >stdout 2>stderr &&
>         test_must_be_empty stdout &&
>         test_grep "Enumerating objects" stderr &&
>     -	test_grep "Computing commit graph generation numbers" stderr
>     +	test_grep "Computing commit graph generation numbers: 100% (4/4), done." stderr
>      '
>
>      test_expect_success 'gc --quiet' '
Good idea!

Thank you, Johannes

Previous: Patrick SteinhardtNext: Taylor Blau
Message 3 of 4 in “commit-graph: increment progress indicator”
  1. commit-graph: increment progress indicatorJohannes Schindelin via GitGitGadget, Jun 11, 2024
  2. Patrick SteinhardtJun 12, 2024
  3. Johannes SchindelinJun 12, 2024
  4. Taylor BlauJun 12, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.