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

Re: [PATCH v5 1/4] t5541-http-push: add test for chunked

From
Junio C Hamano <gitster@pobox.com>
Date
May 4, 2011, 18:44 UTC
Message-ID
<7vr58ee261.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1304529590-1032-1-git-send-email-rctay89@gmail.com>
Tay Ray Chuan <rctay89@gmail.com> writes:
> +	GIT_CURL_VERBOSE=1 git push -v -v 2>err &&
> +	! grep "Expect: 100-continue" err &&
> +	grep "POST git-receive-pack (376 bytes)" err &&
This "376 bytes" bothers me. Can our packing algorithm never improve?
Show 13 quoted lines
>  	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
>  	 test $HEAD = $(git rev-parse --verify HEAD))
>  '
> @@ -140,5 +142,17 @@ test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatc
>  		output
>  '
>  
> +test_expect_success 'push (chunked)' '
> +	git checkout master &&
> +	test_commit commit path3 &&
> +	HEAD=$(git rev-parse --verify HEAD) &&
> +	git config http.postbuffer 4 &&
> +	test_when_finished git config --unset http.postbuffer &&

It probably is a good style to send the command line as a single argument. There are a few violations in the existing code but that is not an excuse to add more violations.

Show 8 quoted lines
> +	git push -v -v origin $BRANCH 2>err &&
> +	grep "POST git-receive-pack (chunked)" err &&
> +	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
> +	 test $HEAD = $(git rev-parse --verify HEAD))
> +'
> +
>  stop_httpd
>  test_done
I'll queue this with the following trivial fix-up.
By the way, the "(chunked) test" is failing for me, with
  Pushing to http://127.0.0.1:5541/smart/test_repo.git
  POST git-receive-pack (chunked)
  POST git-receive-pack (chunked)
  POST git-receive-pack (chunked)
  fatal: The remote end hung up unexpectedly
  fatal: The remote end hung up unexpectedly

in trash/test_repo_clone/err; sometimes with two POSTs and sometimes with three POSTs before we get the "fatal:".

---
 t/t5541-http-push.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index fec552c..4b93fa1 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -74,7 +74,7 @@ test_expect_success 'push to remote repository (standard)' '
 	HEAD=$(git rev-parse --verify HEAD) &&
 	GIT_CURL_VERBOSE=1 git push -v -v 2>err &&
 	! grep "Expect: 100-continue" err &&
-	grep "POST git-receive-pack (376 bytes)" err &&
+	grep "POST git-receive-pack ([0-9]* bytes)" err &&
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
 	 test $HEAD = $(git rev-parse --verify HEAD))
 '
@@ -147,7 +147,7 @@ test_expect_success 'push (chunked)' '
 	test_commit commit path3 &&
 	HEAD=$(git rev-parse --verify HEAD) &&
 	git config http.postbuffer 4 &&
-	test_when_finished git config --unset http.postbuffer &&
+	test_when_finished "git config --unset http.postbuffer" &&
 	git push -v -v origin $BRANCH 2>err &&
 	grep "POST git-receive-pack (chunked)" err &&
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
Previous: Junio C HamanoNext: Junio C Hamano
Message 19 of 20 in “http cleanups”
  1. 0/4 http cleanupsTay Ray Chuan, May 3, 2011
  2. 1/4 t5541-http-push: add test for chunkedTay Ray Chuan, May 3, 2011
  3. 2/4 http: make curl callbacks match contracts from curl headerTay Ray Chuan, May 3, 2011
  4. 3/4 http-push: use const for strings in signaturesTay Ray Chuan, May 3, 2011
  5. 4/4 http-push: refactor curl_easy_setup madnessTay Ray Chuan, May 3, 2011
  6. Shawn PearceMay 3, 2011
  7. Tay Ray ChuanMay 3, 2011
  8. Junio C HamanoMay 4, 2011
  9. Junio C HamanoMay 4, 2011
  10. Tay Ray ChuanMay 4, 2011
  11. 0/4 http cleanupsTay Ray Chuan, May 4, 2011
  12. 1/4 t5541-http-push: add test for chunkedTay Ray Chuan, May 4, 2011
  13. 2/4 http: make curl callbacks match contracts from curl headerTay Ray Chuan, May 4, 2011
  14. 3/4 http-push: use const for strings in signaturesTay Ray Chuan, May 4, 2011
  15. 4/4 http-push: refactor curl_easy_setup madnessTay Ray Chuan, May 4, 2011
  16. Jakub NarebskiMay 4, 2011
  17. Junio C HamanoMay 4, 2011
  18. Junio C HamanoMay 4, 2011
  19. Junio C HamanoMay 4, 2011
  20. Junio C HamanoMay 4, 2011

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.