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

[PATCH 1/4] git-push: fix an error message so it goes to stderr

From
Larry D'Anna <larry@elder-gods.org>
Date
Feb 26, 2010, 19:50 UTC
Message-ID
<06e8e98b7ea63061e59e74c42f7d73cb00e579f6.1267211537.git.larry@elder-gods.org>
In-Reply-To
<cover.1267211537.git.larry@elder-gods.org>
These sort of messages typically go to the standard error.
Signed-off-by: Larry D'Anna <larry@elder-gods.org>
---
 builtin-push.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin-push.c b/builtin-push.c
index 5633f0a..0a27072 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -124,9 +124,9 @@ static int push_with_options(struct transport *transport, int flags)
 		return 0;
 
 	if (nonfastforward && advice_push_nonfastforward) {
-		printf("To prevent you from losing history, non-fast-forward updates were rejected\n"
-		       "Merge the remote changes before pushing again.  See the 'Note about\n"
-		       "fast-forwards' section of 'git push --help' for details.\n");
+		fprintf(stderr, "To prevent you from losing history, non-fast-forward updates were rejected\n"
+				"Merge the remote changes before pushing again.  See the 'Note about\n"
+				"fast-forwards' section of 'git push --help' for details.\n");
 	}
 
 	return 1;
-- 
1.7.0.rc2.40.g7d8aa
Previous: Larry D'AnnaNext: Larry D'Anna
Message 2 of 6 in “ld/push-porcelain”
  1. 0/4 ld/push-porcelainLarry D'Anna, Feb 26, 2010
  2. 1/4 git-push: fix an error message so it goes to stderrLarry D'Anna, Feb 26, 2010
  3. 2/4 git-push: squelch advice message if in --porcelain modeLarry D'Anna, Feb 26, 2010
  4. Junio C HamanoFeb 26, 2010
  5. 3/4 git-push: send "To <remoteurl>" messages to the standard output in --porcelain modeLarry D'Anna, Feb 26, 2010
  6. 4/4 git-push: make git push --dry-run --porcelain exit with status 0 even if updates will be rejectedLarry D'Anna, Feb 26, 2010

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.