git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Derrick Stolee <stolee@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Ayush Chandekar <ayu.chandekar@gmail.com>
Cc: christian.couder@gmail.com, git@vger.kernel.org,
	shyamthakkar001@gmail.com, ps@pks.im, ben.knoble@gmail.com
Subject: Re: [GSOC PATCH v6 0/3] environment: remove sparse-checkout related global variables
Date: Wed, 30 Jul 2025 09:53:21 +0100	[thread overview]
Message-ID: <d61c966b-61ae-4ba9-b983-c8dab6e2c292@gmail.com> (raw)
In-Reply-To: <43aaec10-2696-44c9-8728-2045b83dc5d3@gmail.com>

On 24/07/2025 14:25, Derrick Stolee wrote:
> 
> I think that the core issue here (and probably causing the issues
> that were seen in the user-facing issues) is that the repo settings
> struct was intended as a place to fill config for some one-off
> "feature flags" and not to replace core functionality for a repo.
> 
> There are two ways to change the approach here to fix the problem
> of needing prepare_repo_settings() everyhwere:
> 
>   1. With the idea that these sparse-checkout variables are
>      critical to the functionality of the repo, they should move
>      into the repository struct itself and be initialized along
>      with all other values there. This changes the patches (and my
>      follow-up series) significantly, but mechanically.

Patrick and I had a discussion about calling prepare_repo_settings() 
from repo_read_config() recently [1]. It turned out that does not work 
but I wonder if instead we could change git_default_config() to expect a 
repository pointer as the callback data and use that to initialize 
things. That would mean that we would not need to move code out of 
git_default_config() to remove global variables and we would retain the 
"last one wins" behavior when two or more config keys such are 
"merge.log" and "merge.summary" set the same variable. It would be 
fairly invasive though as we'd need to pass the repository pointer down 
through all the other callbacks that end up calling git_default_config().

Thanks

Phillip

[1] 
https://lore.kernel.org/git/f6479d6a-32a4-4a49-a75c-589978cb9a57@gmail.com/

>   2. If we are going to change the intention of the repo settings
>      struct to move from "optional one-off feature flags" to
>      "important information about the core behavior of a repo"
>      then we should prepare_repo_settings() when initializing the
>      repository struct.
> 
> My preference is (1). The only argument for (2) that I can think
> of is that it is sometimes helpful to share only the settings for
> a repo without sharing the whole repo. But that seems like a weak
> reason right now.
> 
>>> * For 3/3, Phillip told me that it broke user-facing as it will be
>>>    parsed quite late in the callchain and might throw an error mid
>>>    operation which we do not want.
>>
>> So has the behaviour change caused by 3/3 been resolved?
> 
>>   * This throws everything in repo_settings, but these settings are
>>     inherently per repository and they are meaningful only when you
>>     are working with a repository.  What makes us choose to make them
>>     new members in the repo_settings structure, not direct members in
>>     the repository structure?
> 
> (This is the same thought I expressed earlier in this message.)
> 
> Thanks,
> -Stolee
> 
> 


  parent reply	other threads:[~2025-07-30  8:53 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 13:18 [GSOC PATCH] environment: move access to "core.sparsecheckout" into repo_settings Ayush Chandekar
2025-06-03 13:41 ` Patrick Steinhardt
2025-06-03 16:20   ` Ayush Chandekar
2025-06-04  2:20     ` Ben Knoble
2025-06-04  7:28       ` Patrick Steinhardt
2025-06-04 23:48       ` Ayush Chandekar
2025-06-08  0:31 ` [GSOC PATCH v2] " Ayush Chandekar
2025-06-08  6:39   ` Christian Couder
2025-06-11 17:34 ` [PATCH v3] " Ayush Chandekar
2025-06-11 21:06   ` Junio C Hamano
2025-06-11 21:33     ` Junio C Hamano
2025-06-13  6:57       ` Ayush Chandekar
2025-06-17 12:06 ` [GSOC PATCH v4 0/3] environment: remove sparse-checkout related global variables Ayush Chandekar
2025-06-17 12:06   ` [GSOC PATCH v4 1/3] environment: move access to "core.sparsecheckout" into repo_settings Ayush Chandekar
2025-06-17 16:15     ` Junio C Hamano
2025-06-17 12:06   ` [GSOC PATCH v4 2/3] environment: move access to "core.sparsecheckoutcone" " Ayush Chandekar
2025-06-17 16:29     ` Junio C Hamano
2025-06-17 12:06   ` [GSOC PATCH v4 3/3] environment: remove the global variable 'sparse_expect_files_outside_of_patterns' Ayush Chandekar
2025-06-17 16:30     ` Junio C Hamano
2025-06-30 19:27 ` [GSOC PATCH v5 0/3] environment: remove sparse-checkout related global variables Ayush Chandekar
2025-06-30 19:27   ` [GSOC PATCH v5 1/3] environment: move access to "core.sparsecheckout" into repo_settings Ayush Chandekar
2025-06-30 19:27   ` [GSOC PATCH v5 2/3] environment: move access to "core.sparsecheckoutcone" " Ayush Chandekar
2025-06-30 19:27   ` [GSOC PATCH v5 3/3] environment: remove the global variable 'sparse_expect_files_outside_of_patterns' Ayush Chandekar
2025-07-01 13:18     ` Phillip Wood
2025-07-01 23:53       ` Ayush Chandekar
2025-07-02  9:01         ` Phillip Wood
2025-07-11 19:24           ` Ayush Chandekar
2025-07-02  9:21         ` Junio C Hamano
2025-07-11 19:35           ` Ayush Chandekar
2025-06-30 21:08   ` [GSOC PATCH v5 0/3] environment: remove sparse-checkout related global variables Junio C Hamano
2025-07-09  0:18   ` Junio C Hamano
2025-07-09  1:39     ` Ayush Chandekar
2025-07-19  0:11 ` [GSOC PATCH v6 " Ayush Chandekar
2025-07-19  0:11   ` [GSOC PATCH v6 1/3] environment: move access to "core.sparsecheckout" into repo_settings Ayush Chandekar
2025-07-19  0:11   ` [GSOC PATCH v6 2/3] environment: move access to "core.sparsecheckoutcone" " Ayush Chandekar
2025-07-19  0:11   ` [GSOC PATCH v6 3/3] environment: remove the global variable 'sparse_expect_files_outside_of_patterns' Ayush Chandekar
2025-07-23 22:14   ` [GSOC PATCH v6 0/3] environment: remove sparse-checkout related global variables Junio C Hamano
2025-07-24 13:25     ` Derrick Stolee
2025-07-24 18:44       ` Junio C Hamano
2025-07-29 11:36       ` Ayush Chandekar
2025-07-29 12:19         ` Derrick Stolee
2025-07-29 12:53         ` Ayush Chandekar
2025-07-30  8:53       ` Phillip Wood [this message]
2025-07-30 15:52         ` Junio C Hamano
2025-07-26 23:55     ` Ayush Chandekar
2025-08-10 15:36   ` Ayush Chandekar
2025-08-26 12:20     ` Derrick Stolee
2025-08-27 21:31       ` Ayush Chandekar
2025-09-05 14:15         ` Junio C Hamano
2025-09-05 17:10           ` Junio C Hamano

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=d61c966b-61ae-4ba9-b983-c8dab6e2c292@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=ayu.chandekar@gmail.com \
    --cc=ben.knoble@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ps@pks.im \
    --cc=shyamthakkar001@gmail.com \
    --cc=stolee@gmail.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).