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

[PATCH 2/4] git-push: send "To <remoteurl>" messages to the standard output in --porcelain mode

From
Larry D'Anna <larry@elder-gods.org>
Date
Feb 27, 2010, 04:52 UTC
Message-ID
<0ecbc2ed26f4fe0a253bd34f94ffae8f71f81aea.1267245870.git.larry@elder-gods.org>
In-Reply-To
<cover.1267245870.git.larry@elder-gods.org>

git-push prints the line "To <remoteurl>" before above each of the ref status lines. In --porcelain mode, these "To <remoteurl>" lines go to the standard error, but the ref status lines go to the standard output. This makes it difficult for the process reading standard output to know which ref status lines correspond to which remote. This patch sends the "To <remoteurl>" lines to the the standard output instead.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
---
 transport.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/transport.c b/transport.c
index 08e4fa0..32885f7 100644
--- a/transport.c
+++ b/transport.c
@@ -675,7 +675,7 @@ static void print_ok_ref_status(struct ref *ref, int porcelain)
 static int print_one_push_status(struct ref *ref, const char *dest, int count, int porcelain)
 {
 	if (!count)
-		fprintf(stderr, "To %s\n", dest);
+		fprintf(porcelain ? stdout : stderr, "To %s\n", dest);
 
 	switch(ref->status) {
 	case REF_STATUS_NONE:
-- 
1.7.0.rc2.40.g7d8aa
Previous: Larry D'AnnaNext: Larry D'Anna
Message 3 of 6 in “ld/push-porcelain”
  1. 0/4 ld/push-porcelainLarry D'Anna, Feb 27, 2010
  2. 1/4 git-push: fix an advice message so it goes to stderrLarry D'Anna, Feb 27, 2010
  3. 2/4 git-push: send "To <remoteurl>" messages to the standard output in --porcelain modeLarry D'Anna, Feb 27, 2010
  4. 3/4 git-push: make git push --porcelain print "Done"Larry D'Anna, Feb 27, 2010
  5. Tay Ray ChuanFeb 27, 2010
  6. 4/4 git-push: add tests for git push --porcelainLarry D'Anna, Feb 27, 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.