Git development
 help / color / mirror / Atom feed
From: erik@cervined.in
To: git@vger.kernel.org
Cc: gitster@pobox.com, cat@malon.dev, Erik Cervin-Edin <erik@cervined.in>
Subject: [PATCH v2] Reintegrate: send "Huh?" warnings to stderr, not stdout
Date: Mon,  4 May 2026 12:28:44 +0200	[thread overview]
Message-ID: <20260504102844.74734-2-erik@cervined.in> (raw)
In-Reply-To: <ae896PlyiYeqldFN@mbp>

From: Erik Cervin-Edin <erik@cervined.in>

In show_merge(), the "Huh?: $msg" warning -- emitted when a
first-parent merge subject does not match either "Merge branch '...'"
or "Merge remote branch '...'" -- is meant to go to stderr, but the
redirect

	echo 2>&1 "Huh?: $msg"

goes the wrong way and sends the message to stdout instead.

In the common Reintegrate invocation that captures stdout, e.g.

	Meta/Reintegrate next..seen >Meta/redo-seen.sh

this means the warning is silently embedded in the generated heredoc
body instead of being printed to the maintainer's terminal, with no
diagnostic that something went wrong. Worse, the resulting redo-*
script is corrupted with a "Huh?:..." line.

Switch the redirection to ">&2", matching every other diagnostic in
this script.

Signed-off-by: Erik Cervin-Edin <erik@cervined.in>
---
 Reintegrate | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Reintegrate b/Reintegrate
index a1e67a0330..6fdc7c5f41 100755
--- a/Reintegrate
+++ b/Reintegrate
@@ -327,7 +327,7 @@ show_merge () {
 		merge_hier=
 		;;
 	*)
-		echo 2>&1 "Huh?: $msg"
+		echo >&2 "Huh?: $msg"
 		return
 		;;
 	esac &&
-- 
2.53.0


      parent reply	other threads:[~2026-05-04 10:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 10:47 [PATCH] Reintegrate: send "Huh?" warnings to stderr, not stdout Erik Cervin-Edin
2026-04-28 18:05 ` Tian Yuchen
2026-05-04 10:03   ` Erik Cervin Edin
2026-05-04 10:28 ` erik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260504102844.74734-2-erik@cervined.in \
    --to=erik@cervined.in \
    --cc=cat@malon.dev \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox