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

Re: [PATCH v1 0/3] environment: migrate more global variables, pt.2

From
Tian Yuchen <cat@malon.dev>
Date
Jul 26, 2026, 06:29 UTC
Message-ID
<ab900bd2-0524-4122-8bb7-e3f57b0a86fc@malon.dev>
In-Reply-To
<xmqq5x23ypcf.fsf@gitster.g>
On 7/26/26 01:02, Junio C Hamano wrote:
Show 44 quoted lines
> Tian Yuchen <cat@malon.dev> writes:
> 
>> Hi all,
>>
>> This series moves:
>>
>>   - (1/3) minimum_abbrev and default_abbrev
>>   - (2/3) pack_size_limit_cfg
>>   - (3/3) assume_unchanged
>>
>> into repo_config_values to continue the libification effort.
>>
>> Note: in commit 1/3, we need (repo != the_repository) checks in the
>> getters, because some subsystems where the readers of _abbrev
>> configurations live forbid the use of 'the_repository' and only accept
>> 'repo' [1]. We have to explicitly intercept those intances that are
>> not 'the_repository'.
> 
> Sorry but I am not sure I follow.  If a repository that is not
> the_repository is not yet allowed, shouldn't the caller be flagged
> for passing a random repository that is not the_repository as not
> conforming to the API (yet) with:
> 
>          if (repo != the_repository)
>                  BUG(...);
> 
> rather than papering over the issue with an unconditional
> 
>          repo = the_repository;
> 
> override?
> 
> If the API that deals with this 'abbrev' setting needs to call
> another API that only superficially takes any 'repo' parameter
> without supporting anything other than the_repository, isn't that a
> sign that the other API needs to be extended to work with any 'repo'
> before the 'abbrev' part of the system can use it, simply because the
> former is not ready?  Futzing with the 'abbrev' part of the system in
> such a state piles on more unfinished work that will need to be fixed
> later without achieving anything, except for the superficial "now
> this part too can take a 'repo' parameter, even though it does not
> support anything but the_repository", no?
> 
> Puzzled...

I was also wondering if doing this was appropriate... Since that's the case, let's not migrate the _abbrev variable for now. I'll expand this series, migrate some other variables and resend it when ready.

Regards, yuchen
Previous: Junio C HamanoNext: Tian Yuchen
Message 6 of 9 in “environment: migrate more global variables, pt.2”
  1. 0/3 environment: migrate more global variables, pt.2Tian Yuchen, Jul 25, 2026
  2. 1/3 environment: migrate minimum_abbrev and default_abbrevTian Yuchen, Jul 25, 2026
  3. 2/3 environment: migrate pack_size_limit_cfg into repo_config_valuesTian Yuchen, Jul 25, 2026
  4. 3/3 environment: migrate assume_unchanged into repo_config_valuesTian Yuchen, Jul 25, 2026
  5. Junio C HamanoJul 25, 2026
  6. Tian YuchenJul 26, 2026
  7. 0/2 environment: migrate more global variables intoTian Yuchen, Jul 28, 2026
  8. 1/2 environment: migrate pack_size_limit_cfg into repo_config_valuesTian Yuchen, Jul 28, 2026
  9. 2/2 environment: migrate assume_unchanged into repo_config_valuesTian Yuchen, Jul 28, 2026

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.