Skip to content

Commit 0cfcb16

Browse files
committed
Merge branch 'tz/notes-error-to-stderr' into maint
"git notes" sent its error message to its standard output stream, which was corrected. * tz/notes-error-to-stderr: notes: send "Automatic notes merge failed" messages to stderr
2 parents 2ace172 + 89b9e31 commit 0cfcb16

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

builtin/notes.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -865,10 +865,10 @@ static int merge(int argc, const char **argv, const char *prefix)
865865
if (create_symref("NOTES_MERGE_REF", default_notes_ref(), NULL))
866866
die(_("failed to store link to current notes ref (%s)"),
867867
default_notes_ref());
868-
printf(_("Automatic notes merge failed. Fix conflicts in %s and "
869-
"commit the result with 'git notes merge --commit', or "
870-
"abort the merge with 'git notes merge --abort'.\n"),
871-
git_path(NOTES_MERGE_WORKTREE));
868+
fprintf(stderr, _("Automatic notes merge failed. Fix conflicts in %s "
869+
"and commit the result with 'git notes merge --commit', "
870+
"or abort the merge with 'git notes merge --abort'.\n"),
871+
git_path(NOTES_MERGE_WORKTREE));
872872
}
873873

874874
free_notes(t);

t/t3310-notes-merge-manual-resolve.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ git rev-parse refs/notes/z > pre_merge_z
176176
test_expect_success 'merge z into m (== y) with default ("manual") resolver => Conflicting 3-way merge' '
177177
git update-ref refs/notes/m refs/notes/y &&
178178
git config core.notesRef refs/notes/m &&
179-
test_must_fail git notes merge z >output &&
179+
test_must_fail git notes merge z >output 2>&1 &&
180180
# Output should point to where to resolve conflicts
181181
test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
182182
# Inspect merge conflicts
@@ -379,7 +379,7 @@ git rev-parse refs/notes/z > pre_merge_z
379379
test_expect_success 'redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge' '
380380
git update-ref refs/notes/m refs/notes/y &&
381381
git config core.notesRef refs/notes/m &&
382-
test_must_fail git notes merge z >output &&
382+
test_must_fail git notes merge z >output 2>&1 &&
383383
# Output should point to where to resolve conflicts
384384
test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
385385
# Inspect merge conflicts
@@ -413,7 +413,7 @@ git rev-parse refs/notes/y > pre_merge_y
413413
git rev-parse refs/notes/z > pre_merge_z
414414

415415
test_expect_success 'redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge' '
416-
test_must_fail git notes merge z >output &&
416+
test_must_fail git notes merge z >output 2>&1 &&
417417
# Output should point to where to resolve conflicts
418418
test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
419419
# Inspect merge conflicts
@@ -494,7 +494,7 @@ cp expect_log_y expect_log_m
494494

495495
test_expect_success 'redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge' '
496496
git update-ref refs/notes/m refs/notes/y &&
497-
test_must_fail git notes merge z >output &&
497+
test_must_fail git notes merge z >output 2>&1 &&
498498
# Output should point to where to resolve conflicts
499499
test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
500500
# Inspect merge conflicts

t/t3320-notes-merge-worktrees.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '
6161
(
6262
cd worktree2 &&
6363
git config core.notesRef refs/notes/x &&
64-
test_must_fail git notes merge z 2>&1 >out &&
64+
test_must_fail git notes merge z >out 2>&1 &&
6565
test_i18ngrep "Automatic notes merge failed" out &&
6666
grep -v "A notes merge into refs/notes/x is already in-progress in" out
6767
) &&

0 commit comments

Comments
 (0)