From: Stefan Beller <sbeller@google.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git <git@vger.kernel.org>, Brandon Williams <bmwill@google.com>
Subject: Re: [PATCH v2 2/3] upload-pack: read config when serving protocol v2
Date: Thu, 3 May 2018 12:08:16 -0700 [thread overview]
Message-ID: <CAGZ79kb4gHO=5aYMbT=AhZrOexkmkRakJRPRZd_GMrQJTF3WwQ@mail.gmail.com> (raw)
In-Reply-To: <6e85aaa555f6789156626330327085207b2d2dff.1525220786.git.jonathantanmy@google.com>
On Tue, May 1, 2018 at 5:31 PM, Jonathan Tan <jonathantanmy@google.com> wrote:
> 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 ?
> +'
> +
> # 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
>
next prev parent reply other threads:[~2018-05-03 19:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-01 22:22 [PATCH 0/2] Supporting partial clones in protocol v2 Jonathan Tan
2018-05-01 22:22 ` [PATCH 1/2] upload-pack: fix error message typo Jonathan Tan
2018-05-01 22:25 ` Jonathan Tan
2018-05-01 22:22 ` [PATCH 2/2] {fetch,upload}-pack: support filter in protocol v2 Jonathan Tan
2018-05-01 22:36 ` Brandon Williams
2018-05-02 0:31 ` [PATCH v2 0/3] Supporting partial clones " Jonathan Tan
2018-05-02 0:31 ` [PATCH v2 1/3] upload-pack: fix error message typo Jonathan Tan
2018-05-03 18:58 ` Stefan Beller
2018-05-03 23:41 ` Jonathan Tan
2018-05-04 2:24 ` Junio C Hamano
2018-05-04 16:10 ` Jonathan Tan
2018-05-02 0:31 ` [PATCH v2 2/3] upload-pack: read config when serving protocol v2 Jonathan Tan
2018-05-03 19:08 ` Stefan Beller [this message]
2018-05-03 23:45 ` Jonathan Tan
2018-05-02 0:31 ` [PATCH v2 3/3] {fetch,upload}-pack: support filter in " Jonathan Tan
2018-05-03 20:15 ` Stefan Beller
2018-05-03 23:46 ` [PATCH v3 0/3] Supporting partial clones " Jonathan Tan
2018-05-03 23:46 ` [PATCH v3 1/3] upload-pack: fix error message typo Jonathan Tan
2018-05-03 23:46 ` [PATCH v3 2/3] upload-pack: read config when serving protocol v2 Jonathan Tan
2018-05-03 23:46 ` [PATCH v3 3/3] {fetch,upload}-pack: support filter in " Jonathan Tan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGZ79kb4gHO=5aYMbT=AhZrOexkmkRakJRPRZd_GMrQJTF3WwQ@mail.gmail.com' \
--to=sbeller@google.com \
--cc=bmwill@google.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).