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

[PATCH] pre-push.sample: Write error message to stderr

From
W. Trevor King <wking@tremily.us>
Date
Sep 11, 2014, 20:35 UTC
Message-ID
<48e0d9c541a5aad9644a0d1ec67b67de454cde5b.1410467299.git.wking@tremily.us>
githooks(5) suggests:
  Information about why the push is rejected may be sent to the user
  by writing to standard error.
So follow that advice in the sample.
Signed-off-by: W. Trevor King <wking@tremily.us>
---
 templates/hooks--pre-push.sample | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
index 1f3bceb..7cb911c 100755
--- a/templates/hooks--pre-push.sample
+++ b/templates/hooks--pre-push.sample
@@ -45,7 +45,7 @@ do
 		commit=`git rev-list -n 1 --grep '^WIP' "$range"`
 		if [ -n "$commit" ]
 		then
-			echo "Found WIP commit in $local_ref, not pushing"
+			echo "Found WIP commit in $local_ref, not pushing" >&2
 			exit 1
 		fi
 	fi
-- 
2.1.0.60.g85f0837
Message 1 of 1 in “pre-push.sample: Write error message to stderr”
  1. pre-push.sample: Write error message to stderrW. Trevor King, Sep 11, 2014

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.