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

Re: [GSOC PATCH v6 0/3] environment: remove sparse-checkout related global variables

From
Ayush Chandekar <ayu.chandekar@gmail.com>
Date
Jul 26, 2025, 23:55 UTC
Message-ID
<CAE7as+b2rSiXziZE0a3BdvPZ5h2961vOUX=zgvnjgvwPKbCHyg@mail.gmail.com>
In-Reply-To
<xmqqcy9qlfm8.fsf@gitster.g>
On Thu, Jul 24, 2025 at 3:44 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 21 quoted lines
>
> Ayush Chandekar <ayu.chandekar@gmail.com> writes:
>
> >
> > * For 1/3 and 2/3, Junio told me that it was concerning to put so
> >   many calls to `prepare_repo_settings()` so I tried to minimize the
> >   calls and made sure that there's no useless calling.
>
> I didn't mean that the number of places is the problem.  What I
> found troubling was that this is not done in any central place, so
> it is hard to notice even if some random cmd_foo() failed to call
> the function before doing its real work.  For example, shouldn't we
> be able to, at least for built-in commands that have RUN_SETUP bit
> set, centrally call prepare_repo_settings() somewhere late in
> git.c:run_builtin() after we figure out what should be in
> the_repository?  Now historically, setting up a repository may never
> have involved opening and parsing tons of configuration files, so
> such a change may be incurring extra overhead we did not have to
> pay, so it needs a lot more thought than just trying to minimize the
> number of calls, but some performance measurement.
>

I was quite stumped as I don't know what the perfect solution for this would be. I get your point that we have calls to the function all over the place and would take some toll on the performance as well. As you said that we can probably call the function in git.c:run_builtin() or we can have a call to it in config.c:repo_config() so that just as the other settings, we will have our repo_settings parsed, which were once parsed through the same function(repo_config() or git_config()) and since all the cmd_*() functions have a call to this, we will also be able to call prepare_repo_settings() there itself.

Show 5 quoted lines
> > * 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?

Well, I am not parsing it at that place. But, I am relying on an already existing call to prepre_repo_settings() before the function using the setting is called repository.c:repo_read_index(). I tried to narrow down to a cmd_foo() function so that I can shift a call to the prepare_repo_settings() from repo_read_index() to it, but this function is widely called and cannot be narrowed down so I had to settle with it. I'm afraid the issue still isn't completely resolved

Show 12 quoted lines
>
> A meta-level comment and a half.
>
>  * Please do not use "-- " (that is a line that has dash dash and a
>    single space and nothing else on it) lightly.  It is called
>    signature line and often MUA pays attention to it when responding
>    to a message with such a line by omitting everything after it
>    (which is supposed to be your "who I am" advertisement) when
>    quoting the original.  Since you had one before the "discussions
>    since v5" section and the range-diff, I had to manually resurrect
>    the part after the signature line while composing this message.
>
I am sorry for that. I will keep that in mind from next time.
Show 10 quoted lines
>  * 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?
>
>    Not an objection and not a suggestion to move them out of the
>    repo_settings and to the repository proper.  Just wanted to hear
>    the reasoning behind it (and have the rationale clearly
>    documented, preferrably in the proposed log messages).

Yeah, so what I thought was that if it is a "core.foo" setting, I would club it with other core.* settings in the struct repo_settings. But other config settings like in the previous patch series, "extensions.preciousObjects" or also in this series, the "sparse.expectfilesoutsideofpatterns", I would put them in some local context or if they're tied to a repository, I would store them in the repository struct itself. But, as other "core.sparse_*" variables are stored in the repo_settings, I thought it was better to store the "sparse.expectfilesoutsideofpatterns" along with them rather than storing it in the repository.

Thanks Ayush

Previous: Junio C HamanoNext: Ayush Chandekar
Message 45 of 50 in “environment: move access to "core.sparsecheckout" into repo_settings”
  1. environment: move access to "core.sparsecheckout" into repo_settingsAyush Chandekar, Jun 3, 2025
  2. Patrick SteinhardtJun 3, 2025
  3. Ayush ChandekarJun 3, 2025
  4. Ben KnobleJun 4, 2025
  5. Patrick SteinhardtJun 4, 2025
  6. Ayush ChandekarJun 4, 2025
  7. environment: move access to "core.sparsecheckout" into repo_settingsAyush Chandekar, Jun 8, 2025
  8. Christian CouderJun 8, 2025
  9. environment: move access to "core.sparsecheckout" into repo_settingsAyush Chandekar, Jun 11, 2025
  10. Junio C HamanoJun 11, 2025
  11. Junio C HamanoJun 11, 2025
  12. Ayush ChandekarJun 13, 2025
  13. 0/3 environment: remove sparse-checkout related global variablesAyush Chandekar, Jun 17, 2025
  14. 1/3 environment: move access to "core.sparsecheckout" into repo_settingsAyush Chandekar, Jun 17, 2025
  15. Junio C HamanoJun 17, 2025
  16. 2/3 environment: move access to "core.sparsecheckoutcone" into repo_settingsAyush Chandekar, Jun 17, 2025
  17. Junio C HamanoJun 17, 2025
  18. 3/3 environment: remove the global variable 'sparse_expect_files_outside_of_patterns'Ayush Chandekar, Jun 17, 2025
  19. Junio C HamanoJun 17, 2025
  20. 0/3 environment: remove sparse-checkout related global variablesAyush Chandekar, Jun 30, 2025
  21. 1/3 environment: move access to "core.sparsecheckout" into repo_settingsAyush Chandekar, Jun 30, 2025
  22. 2/3 environment: move access to "core.sparsecheckoutcone" into repo_settingsAyush Chandekar, Jun 30, 2025
  23. 3/3 environment: remove the global variable 'sparse_expect_files_outside_of_patterns'Ayush Chandekar, Jun 30, 2025
  24. Phillip WoodJul 1, 2025
  25. Ayush ChandekarJul 1, 2025
  26. Phillip WoodJul 2, 2025
  27. Ayush ChandekarJul 11, 2025
  28. Junio C HamanoJul 2, 2025
  29. Ayush ChandekarJul 11, 2025
  30. Junio C HamanoJun 30, 2025
  31. Junio C HamanoJul 9, 2025
  32. Ayush ChandekarJul 9, 2025
  33. 0/3 environment: remove sparse-checkout related global variablesAyush Chandekar, Jul 19, 2025
  34. 1/3 environment: move access to "core.sparsecheckout" into repo_settingsAyush Chandekar, Jul 19, 2025
  35. 2/3 environment: move access to "core.sparsecheckoutcone" into repo_settingsAyush Chandekar, Jul 19, 2025
  36. 3/3 environment: remove the global variable 'sparse_expect_files_outside_of_patterns'Ayush Chandekar, Jul 19, 2025
  37. Junio C HamanoJul 23, 2025
  38. Derrick StoleeJul 24, 2025
  39. Junio C HamanoJul 24, 2025
  40. Ayush ChandekarJul 29, 2025
  41. Derrick StoleeJul 29, 2025
  42. Ayush ChandekarJul 29, 2025
  43. Phillip WoodJul 30, 2025
  44. Junio C HamanoJul 30, 2025
  45. Ayush ChandekarJul 26, 2025
  46. Ayush ChandekarAug 10, 2025
  47. Derrick StoleeAug 26, 2025
  48. Ayush ChandekarAug 27, 2025
  49. Junio C HamanoSep 5, 2025
  50. Junio C HamanoSep 5, 2025

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.