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

Re: [PATCH 2/3] bundle-uri: advertise based on repo config

From
Derrick Stolee <derrickstolee@github.com>
Date
Dec 20, 2022, 13:54 UTC
Message-ID
<49eb61a4-2b5d-c695-25e1-621bac6f3421@github.com>
In-Reply-To
<221219.86pmcfzm7g.gmgdl@evledraar.gmail.com>
On 12/19/22 6:04 AM, Ævar Arnfjörð Bjarmason wrote:
Show 41 quoted lines
> 
> 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

Previous: Ævar Arnfjörð BjarmasonNext: Derrick Stolee via GitGitGadget
Message 4 of 17 in “Bundle URIs 4.5: fixups from part IV”
  1. 0/3 Bundle URIs 4.5: fixups from part IVDerrick Stolee via GitGitGadget, Dec 12, 2022
  2. 2/3 bundle-uri: advertise based on repo configDerrick Stolee via GitGitGadget, Dec 12, 2022
  3. Ævar Arnfjörð BjarmasonDec 19, 2022
  4. Derrick StoleeDec 20, 2022
  5. 3/3 bundle-uri: remove GIT_TEST_BUNDLE_URI env variableDerrick Stolee via GitGitGadget, Dec 12, 2022
  6. Ævar Arnfjörð BjarmasonDec 19, 2022
  7. Derrick StoleeDec 20, 2022
  8. Ævar Arnfjörð BjarmasonDec 20, 2022
  9. 1/3 bundle-uri: drop unused 'uri' parameterDerrick Stolee via GitGitGadget, Dec 12, 2022
  10. Ævar Arnfjörð BjarmasonDec 19, 2022
  11. Junio C HamanoDec 20, 2022
  12. Derrick StoleeDec 20, 2022
  13. Ævar Arnfjörð BjarmasonDec 20, 2022
  14. Derrick StoleeDec 20, 2022
  15. Ævar Arnfjörð BjarmasonDec 20, 2022
  16. Victoria DyeDec 12, 2022
  17. Jeff KingDec 12, 2022

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.