Skip to content

Commit

Permalink
Merge pull request git-for-windows#432: sequencer: avoid progress whe…
Browse files Browse the repository at this point in the history
…n stderr is redirected

During a run of the Scalar functional tests, we hit a case where the
inexact rename detection of a 'git cherry-pick' command slowed to the
point of writing its delayed progress, failing the test because stderr
differed from the control case. Showing progress like this when stderr
is not a terminal is non-standard for Git, so inject an isatty(2) when
initializing the progress option in sequencer.c.

Unfortunately, there is no '--quiet' option in 'git cherry-pick'
currently wired up. This could be considered in the future, and the
isatty(2) could be moved to that position. This would also be needed for
commands like 'git rebase', so we leave that for another time.
  • Loading branch information
derrickstolee authored and dscho committed Aug 9, 2023
2 parents d4885cd + 1915faf commit 6c004f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sequencer.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ static int do_recursive_merge(struct repository *r,
o.branch2 = next ? next_label : "(empty tree)";
if (is_rebase_i(opts))
o.buffer_output = 2;
o.show_rename_progress = 1;
o.show_rename_progress = isatty(2);

head_tree = parse_tree_indirect(head);
next_tree = next ? repo_get_commit_tree(r, next) : empty_tree(r);
Expand Down

0 comments on commit 6c004f5

Please sign in to comment.