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

Re: [PATCH v2 2/3] upload-pack: read config when serving protocol v2

From
Stefan Beller <sbeller@google.com>
Date
May 3, 2018, 19:08 UTC
Message-ID
<CAGZ79kb4gHO=5aYMbT=AhZrOexkmkRakJRPRZd_GMrQJTF3WwQ@mail.gmail.com>
In-Reply-To
<6e85aaa555f6789156626330327085207b2d2dff.1525220786.git.jonathantanmy@google.com>
On Tue, May 1, 2018 at 5:31 PM, Jonathan Tan <jonathantanmy@google.com> wrote:
Show 29 quoted lines
> The upload-pack code paths never call git_config() with
> upload_pack_config() when protocol v2 is used, causing options like
> uploadpack.packobjectshook to not take effect. Ensure that this function
> is called.
>
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
>  t/t5702-protocol-v2.sh | 14 ++++++++++++++
>  upload-pack.c          |  2 ++
>  2 files changed, 16 insertions(+)
>
> diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
> index 56f7c3c32..0ead99993 100755
> --- a/t/t5702-protocol-v2.sh
> +++ b/t/t5702-protocol-v2.sh
> @@ -201,6 +201,20 @@ test_expect_success 'ref advertisment is filtered during fetch using protocol v2
>         ! grep "refs/tags/three" log
>  '
>
> +test_expect_success 'upload-pack respects config using protocol v2' '
> +       git init server &&
> +       write_script server/.git/hook <<-\EOF &&
> +               touch hookout
> +               "$@"
> +       EOF
> +       test_commit -C server one &&
> +
> +       test_config_global uploadpack.packobjectshook ./hook &&
> +       test ! -f server/.git/hookout &&
test_path_is_missing ?
> +       GIT_TRACE=/tmp/y git -c protocol.version=2 clone "file://$(pwd)/server" client &&

Why do we redirect GIT_TRACE outside the test suite? do we read that back or want to read it out of the hook?

Is it possible to redirect to  /$(pwd)/trace or such?
> +       test -f server/.git/hookout
test_path_is_file ?
Show 21 quoted lines
> +'
> +
>  # Test protocol v2 with 'http://' transport
>  #
>  . "$TEST_DIRECTORY"/lib-httpd.sh
> diff --git a/upload-pack.c b/upload-pack.c
> index c4456bb88..113edd32d 100644
> --- a/upload-pack.c
> +++ b/upload-pack.c
> @@ -1376,6 +1376,8 @@ int upload_pack_v2(struct repository *r, struct argv_array *keys,
>         enum fetch_state state = FETCH_PROCESS_ARGS;
>         struct upload_pack_data data;
>
> +       git_config(upload_pack_config, NULL);
> +
>         upload_pack_data_init(&data);
>         use_sideband = LARGE_PACKET_MAX;
>
> --
> 2.17.0.441.gb46fe60e1d-goog
>
Previous: Jonathan TanNext: Jonathan Tan
Message 13 of 20 in “Supporting partial clones in protocol v2”
  1. 0/2 Supporting partial clones in protocol v2Jonathan Tan, May 1, 2018
  2. 1/2 upload-pack: fix error message typoJonathan Tan, May 1, 2018
  3. Jonathan TanMay 1, 2018
  4. 2/2 {fetch,upload}-pack: support filter in protocol v2Jonathan Tan, May 1, 2018
  5. Brandon WilliamsMay 1, 2018
  6. 0/3 Supporting partial clones in protocol v2Jonathan Tan, May 2, 2018
  7. 1/3 upload-pack: fix error message typoJonathan Tan, May 2, 2018
  8. Stefan BellerMay 3, 2018
  9. Jonathan TanMay 3, 2018
  10. Junio C HamanoMay 4, 2018
  11. Jonathan TanMay 4, 2018
  12. 2/3 upload-pack: read config when serving protocol v2Jonathan Tan, May 2, 2018
  13. Stefan BellerMay 3, 2018
  14. Jonathan TanMay 3, 2018
  15. 3/3 {fetch,upload}-pack: support filter in protocol v2Jonathan Tan, May 2, 2018
  16. Stefan BellerMay 3, 2018
  17. 0/3 Supporting partial clones in protocol v2Jonathan Tan, May 3, 2018
  18. 1/3 upload-pack: fix error message typoJonathan Tan, May 3, 2018
  19. 2/3 upload-pack: read config when serving protocol v2Jonathan Tan, May 3, 2018
  20. 3/3 {fetch,upload}-pack: support filter in protocol v2Jonathan Tan, May 3, 2018

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.