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

[PATCH 2/4] git-push: squelch advice message if in --porcelain mode

From
Larry D'Anna <larry@elder-gods.org>
Date
Feb 26, 2010, 19:50 UTC
Message-ID
<75b6d65f8028407cc1e8244a57823b3d87c520f1.1267211537.git.larry@elder-gods.org>
In-Reply-To
<cover.1267211537.git.larry@elder-gods.org>

By default, git-push may give the user a verbose advice message if a ref is rejected for not being a fast-forward. This patch squelches that message for --porcelain mode.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
---
 builtin-push.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/builtin-push.c b/builtin-push.c
index 0a27072..aacba45 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -226,6 +226,11 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 	git_config(git_default_config, NULL);
 	argc = parse_options(argc, argv, prefix, options, push_usage, 0);
 
+	if (flags & TRANSPORT_PUSH_PORCELAIN) {
+		/* Do not give advice messages to Porcelain scripts */
+		advice_push_nonfastforward = 0;
+	}
+
 	if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))
 		die("--delete is incompatible with --all, --mirror and --tags");
 	if (deleterefs && argc < 2)
-- 
1.7.0.rc2.40.g7d8aa
Previous: Larry D'AnnaNext: Junio C Hamano
Message 3 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.