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

Re: [PATCH] remote-curl: Fix push status report when all branches fail

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 20, 2012, 18:18 UTC
Message-ID
<7vfwfafdb8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1327079011-24788-1-git-send-email-spearce@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 8 quoted lines
> Always print a blank line after the send-pack process terminates,
> ensuring the helper status report (if it was output) will be
> correctly parsed by the calling transport-helper.c. This ensures
> the helper doesn't abort before the status report can be shown to
> the user.
>
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
> ---
Thanks; let's do the following on top of this patch, so that:
 - We won't miss a "git push" that errorneously succeeds; and
 - We won't be affected by any future change in the sideband #2
   demultiplexor of the amount of "padding".
 t/t5541-http-push.sh |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git b/t/t5541-http-push.sh a/t/t5541-http-push.sh
index d3e340e..b8f4c2a 100755
--- b/t/t5541-http-push.sh
+++ a/t/t5541-http-push.sh
@@ -101,8 +101,8 @@ exit 1
 EOF
 chmod a+x "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update"
 
-printf 'remote: error: hook declined to update refs/heads/dev2        \n' >exp
-cat >>exp <<EOF
+cat >exp <<EOF
+remote: error: hook declined to update refs/heads/dev2
 To http://127.0.0.1:$LIB_HTTPD_PORT/smart/test_repo.git
  ! [remote rejected] dev2 -> dev2 (hook declined)
 error: failed to push some refs to 'http://127.0.0.1:5541/smart/test_repo.git'
@@ -115,8 +115,9 @@ test_expect_success 'rejected update prints status' '
 	git add path4 &&
 	test_tick &&
 	git commit -m dev2 &&
-	git push origin dev2 2>act
-	test_cmp exp act
+	test_must_fail git push origin dev2 2>act &&
+	sed -e "/^remote: /s/ *$//" <act >cmp &&
+	test_cmp exp cmp
 '
 rm -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update"
 

   
Previous: Shawn O. PearceNext: Jeff King
Message 9 of 14 in “remote-curl: Fix push status report when all branches fail”
  1. remote-curl: Fix push status report when all branches failShawn O. Pearce, Jan 19, 2012
  2. Junio C HamanoJan 19, 2012
  3. remote-curl: Fix push status report when all branches failShawn O. Pearce, Jan 20, 2012
  4. Junio C HamanoJan 20, 2012
  5. Junio C HamanoJan 20, 2012
  6. Shawn PearceJan 20, 2012
  7. Thomas RastJan 20, 2012
  8. remote-curl: Fix push status report when all branches failShawn O. Pearce, Jan 20, 2012
  9. Junio C HamanoJan 20, 2012
  10. Jeff KingFeb 22, 2012
  11. Shawn PearceFeb 22, 2012
  12. Jeff KingFeb 22, 2012
  13. Jeff KingFeb 23, 2012
  14. Junio C HamanoFeb 23, 2012

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.