git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Reintegrate: send "Huh?" warnings to stderr, not stdout

From
ECErik Cervin-Edin <erik@cervined.in>
Date
Apr 27, 2026, 10:47 UTC
Message-ID
<ae896PlyiYeqldFN@mbp>

The "Huh?: $msg" warning in show_merge(), emitted when a first-parent merge subject does not match either "Merge branch '...'" or "Merge remote branch '...'", uses

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

The "2>&1" redirect dupes stderr onto stdout's destination; it does not change where stdout itself points. Since echo writes to stdout, the "Huh?:" message lands on stdout regardless -- as would any command's normal output. The intent appears to have been ">&2", which dupes stdout onto stderr.

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. The resulting redo-* script is corrupted with a "Huh?:..." line and the maintainer has no diagnostic that something went wrong.

Every other diagnostic in this script already uses ">&2"; this line is the lone outlier.

Use ">&2" so the warning reaches stderr as intended.
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
Next: Tian Yuchen
Message 1 of 4 in “Reintegrate: send "Huh?" warnings to stderr, not stdout”
  1. Reintegrate: send "Huh?" warnings to stderr, not stdoutErik Cervin-Edin, Apr 27, 2026
  2. Tian YuchenApr 28, 2026
  3. Erik Cervin EdinMay 4, 2026
  4. Reintegrate: send "Huh?" warnings to stderr, not stdouterik@cervined.in, May 4, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.