Skip to content

Commit 3bcd031

Browse files
derrickstoleegitster
authored andcommitted
commit-graph: use start_delayed_progress()
When writing a commit-graph, we show progress along several commit walks. When we use start_delayed_progress(), the progress line will only appear if that step takes a decent amount of time. However, one place was missed: computing generation numbers. This is normally a very fast operation as all commits have been parsed in a previous step. But, this is showing up for all users no matter how few commits are being added. Now that we changed this method, very fast commands show no progess at all. This means we need to stop testing for seeing these progress lines in the test suite. Reported-by: ryenus <[email protected]> Signed-off-by: Derrick Stolee <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent da72936 commit 3bcd031

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

commit-graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ static void compute_generation_numbers(struct write_commit_graph_context *ctx)
11031103
struct commit_list *list = NULL;
11041104

11051105
if (ctx->report_progress)
1106-
ctx->progress = start_progress(
1106+
ctx->progress = start_delayed_progress(
11071107
_("Computing commit graph generation numbers"),
11081108
ctx->commits.nr);
11091109
for (i = 0; i < ctx->commits.nr; i++) {

t/t5318-commit-graph.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ test_expect_success 'commit-graph write progress off for redirected stderr' '
130130
test_line_count = 0 err
131131
'
132132

133-
test_expect_success 'commit-graph write force progress on for stderr' '
134-
cd "$TRASH_DIRECTORY/full" &&
135-
git commit-graph write --progress 2>err &&
136-
test_file_not_empty err
137-
'
138-
139133
test_expect_success 'commit-graph write with the --no-progress option' '
140134
cd "$TRASH_DIRECTORY/full" &&
141135
git commit-graph write --no-progress 2>err &&

t/t6500-gc.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,6 @@ test_expect_success 'auto gc with too many loose objects does not attempt to cre
102102
test_line_count = 2 new # There is one new pack and its .idx
103103
'
104104

105-
test_expect_success 'gc --no-quiet' '
106-
git -c gc.writeCommitGraph=true gc --no-quiet >stdout 2>stderr &&
107-
test_must_be_empty stdout &&
108-
test_line_count = 1 stderr &&
109-
test_i18ngrep "Computing commit graph generation numbers" stderr
110-
'
111-
112-
test_expect_success TTY 'with TTY: gc --no-quiet' '
113-
test_terminal git -c gc.writeCommitGraph=true gc --no-quiet >stdout 2>stderr &&
114-
test_must_be_empty stdout &&
115-
test_i18ngrep "Enumerating objects" stderr &&
116-
test_i18ngrep "Computing commit graph generation numbers" stderr
117-
'
118-
119105
test_expect_success 'gc --quiet' '
120106
git -c gc.writeCommitGraph=true gc --quiet >stdout 2>stderr &&
121107
test_must_be_empty stdout &&

0 commit comments

Comments
 (0)