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

Re: [PATCH v2 5/5] remote-curl: use post_rpc() for protocol v2 also

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 22, 2019, 13:18 UTC
Message-ID
<CAPig+cQNg26zHm=ns3PsmPHEsNo4M7hTSG8=oO_uKqEa4wf3Vw@mail.gmail.com>
In-Reply-To
<b0ff17d324d46822da9db898d187dcc5fb0467ca.1550780213.git.jonathantanmy@google.com>
On Thu, Feb 21, 2019 at 3:25 PM Jonathan Tan <jonathantanmy@google.com> wrote:
Show 18 quoted lines
> diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
> @@ -542,7 +542,38 @@ test_expect_success 'clone with http:// using protocol v2' '
> +test_expect_success 'clone big repository with http:// using protocol v2' '
> +       test_when_finished "rm -f log" &&
> +
> +       git init "$HTTPD_DOCUMENT_ROOT_PATH/big" &&
> +       # Ensure that the list of wants is greater than http.postbuffer below
> +       for i in $(test_seq 1 1500)
> +       do
> +               # do not use here-doc, because it requires a process
> +               # per loop iteration
> +               echo "commit refs/heads/too-many-refs-$i" &&
> +               echo "committer git <git@example.com> $i +0000" &&
> +               echo "data 0" &&
> +               echo "M 644 inline bla.txt" &&
> +               echo "data 4" &&
> +               echo "bla"
> +       done | git -C "$HTTPD_DOCUMENT_ROOT_PATH/big" fast-import &&

Although not outright wrong, maintaining an &&-chain in the loop body is a bit misleading here for a couple reasons. First, without "|| exit 1" at the end of the body, neither the loop nor the test itself will abort early if some command within the body fails. Second, the exit status of the loop is lost anyhow due to being upstream of a pipe.

By the way, I see that this same script already contains a couple tests with loops neglecting the trailing "|| exit 1", hence they too fail to abort early if something goes wrong inside the body (which, in both cases, contains a test_commit() invocation). Fixing those might be fodder as a follow-up patch for someone.

Previous: Jonathan TanNext: Eric Sunshine
Message 17 of 24 in “Protocol v2 fix: http and auth”
  1. 0/5 Protocol v2 fix: http and authJonathan Tan, Feb 14, 2019
  2. 1/5 remote-curl: reduce scope of rpc_state.argvJonathan Tan, Feb 14, 2019
  3. 2/5 remote-curl: reduce scope of rpc_state.stdin_preambleJonathan Tan, Feb 14, 2019
  4. 3/5 remote-curl: reduce scope of rpc_state.resultJonathan Tan, Feb 14, 2019
  5. 4/5 remote-curl: refactor reading into rpc_state's bufJonathan Tan, Feb 14, 2019
  6. 5/5 remote-curl: use post_rpc() for protocol v2 alsoJonathan Tan, Feb 14, 2019
  7. Junio C HamanoFeb 14, 2019
  8. Jeff KingFeb 21, 2019
  9. Jonathan TanFeb 21, 2019
  10. Jeff KingFeb 21, 2019
  11. 0/5 Protocol v2 fix: http and authJonathan Tan, Feb 21, 2019
  12. 1/5 remote-curl: reduce scope of rpc_state.argvJonathan Tan, Feb 21, 2019
  13. 2/5 remote-curl: reduce scope of rpc_state.stdin_preambleJonathan Tan, Feb 21, 2019
  14. 3/5 remote-curl: reduce scope of rpc_state.resultJonathan Tan, Feb 21, 2019
  15. 4/5 remote-curl: refactor reading into rpc_state's bufJonathan Tan, Feb 21, 2019
  16. 5/5 remote-curl: use post_rpc() for protocol v2 alsoJonathan Tan, Feb 21, 2019
  17. Eric SunshineFeb 22, 2019
  18. Eric SunshineFeb 22, 2019
  19. Jeff KingFeb 25, 2019
  20. [FIXUP] Fixup on tip of jt/http-auth-proto-v2-fixJonathan Tan, Feb 25, 2019
  21. Jonathan NiederFeb 26, 2019
  22. Jonathan TanFeb 26, 2019
  23. Junio C HamanoMar 4, 2019
  24. Jeff KingFeb 27, 2019

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.