git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Derrick Stolee <derrickstolee@github.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, peff@peff.net, vdye@github.com, gitster@pobox.com
Subject: Re: [PATCH 2/3] bundle-uri: advertise based on repo config
Date: Tue, 20 Dec 2022 08:54:39 -0500	[thread overview]
Message-ID: <49eb61a4-2b5d-c695-25e1-621bac6f3421@github.com> (raw)
In-Reply-To: <221219.86pmcfzm7g.gmgdl@evledraar.gmail.com>

On 12/19/22 6:04 AM, Ævar Arnfjörð Bjarmason wrote:
> 
> On Mon, Dec 12 2022, Derrick Stolee via GitGitGadget wrote:
> 
>> From: Derrick Stolee <derrickstolee@github.com>
>>
>> The bundle_uri_advertise() method was not using its repository
>> parameter, but this is a mistake. Use repo_config_get_maybe_bool()
>> instead of git_config_maybe_bool().
>>
>> Signed-off-by: Derrick Stolee <derrickstolee@github.com>
>> ---
>>  bundle-uri.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/bundle-uri.c b/bundle-uri.c
>> index 8efb4e7acad..5f158cc52e1 100644
>> --- a/bundle-uri.c
>> +++ b/bundle-uri.c
>> @@ -610,7 +610,7 @@ int bundle_uri_advertise(struct repository *r, struct strbuf *value)
>>  		goto cached;
>>  
>>  	advertise_bundle_uri = 0;
>> -	git_config_get_maybe_bool("uploadpack.advertisebundleuris", &advertise_bundle_uri);
>> +	repo_config_get_maybe_bool(r, "uploadpack.advertisebundleuris", &advertise_bundle_uri);
>>  
>>  cached:
>>  	return advertise_bundle_uri;
> 
> This looks good, but as with another parallel topic of yours that I
> commented on[1] leaves us wondering if this had any effect.
> 
> I.e. is this just for good measure because we have a "r" parameter, or
> did we do the wrong thing for submodules before this change? In that
> case let's add the missing test coverage.
> 
> Or, if it's the former let's update the commit message here, saying e.g.:
> 
> 	While we should use "r" for <good measure or other reason>, we
> 	already did the right thing for submodules, as "the_repository"
> 	would be set to the submodule because <reasons I don't
> 	know about...>.

As I mentioned in another thread, we should always be using a
local 'struct repository *' if we can so we aren't contributing
to that particular dimension of technical debt, but submodules
have a lot of work ahead before these kinds of things can be
tested individually.

This is especially the case when working with server code, where
we would never be in the submodule, but we don't want to block
future removals of the non-repo versions of these methods.

Thanks,
-Stolee

  reply	other threads:[~2022-12-20 13:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12 17:33 [PATCH 0/3] Bundle URIs 4.5: fixups from part IV Derrick Stolee via GitGitGadget
2022-12-12 17:33 ` [PATCH 1/3] bundle-uri: drop unused 'uri' parameter Derrick Stolee via GitGitGadget
2022-12-19 10:57   ` Ævar Arnfjörð Bjarmason
2022-12-20  0:49     ` Junio C Hamano
2022-12-20 14:02       ` Derrick Stolee
2022-12-20 20:50         ` Ævar Arnfjörð Bjarmason
2022-12-20 13:57     ` Derrick Stolee
2022-12-20 20:46       ` Ævar Arnfjörð Bjarmason
2022-12-12 17:33 ` [PATCH 2/3] bundle-uri: advertise based on repo config Derrick Stolee via GitGitGadget
2022-12-19 11:04   ` Ævar Arnfjörð Bjarmason
2022-12-20 13:54     ` Derrick Stolee [this message]
2022-12-12 17:33 ` [PATCH 3/3] bundle-uri: remove GIT_TEST_BUNDLE_URI env variable Derrick Stolee via GitGitGadget
2022-12-19 11:09   ` Ævar Arnfjörð Bjarmason
2022-12-20 13:51     ` Derrick Stolee
2022-12-20 20:41       ` Ævar Arnfjörð Bjarmason
2022-12-12 18:07 ` [PATCH 0/3] Bundle URIs 4.5: fixups from part IV Victoria Dye
2022-12-12 20:59 ` Jeff King

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49eb61a4-2b5d-c695-25e1-621bac6f3421@github.com \
    --to=derrickstolee@github.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=vdye@github.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.
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 NNTP newsgroup(s).