Skip to content

Commit d41fb66

Browse files
committed
Merge branch 'ds/commit-graph-delay-gen-progress' into next
One kind of progress messages were always given during commit-graph generation, instead of following the "if it takes more than two seconds, show progress" pattern, which has been corrected. * ds/commit-graph-delay-gen-progress: Revert "commit-graph: use start_delayed_progress()"
2 parents 0738ff0 + 5a7e634 commit d41fb66

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

commit-graph.c

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

11021102
if (ctx->report_progress)
1103-
ctx->progress = start_delayed_progress(
1103+
ctx->progress = start_progress(
11041104
_("Computing commit graph generation numbers"),
11051105
ctx->commits.nr);
11061106
for (i = 0; i < ctx->commits.nr; i++) {

t/t5318-commit-graph.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ 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+
133139
test_expect_success 'commit-graph write with the --no-progress option' '
134140
cd "$TRASH_DIRECTORY/full" &&
135141
git commit-graph write --no-progress 2>err &&

t/t6500-gc.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@ 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+
105119
test_expect_success 'gc --quiet' '
106120
git -c gc.writeCommitGraph=true gc --quiet >stdout 2>stderr &&
107121
test_must_be_empty stdout &&

0 commit comments

Comments
 (0)