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

Re: [GSOC][PATCH 1/2] editor: make editor_program local to editor.c

From
Karthik Nayak <karthik.188@gmail.com>
Date
Mar 9, 2026, 10:36 UTC
Message-ID
<CAOLa=ZR1_OMnVNKeiZiWDLBBXCtxNveKCgjjTFQAYYCCjqbZ0Q@mail.gmail.com>
In-Reply-To
<aaRzdeg2BkAKa-4J@fedora>
Burak Kaan Karaçay <bkkaracay@gmail.com> writes:
Show 30 quoted lines
> On Sun, Mar 01, 2026 at 04:22:38PM +0000, Phillip Wood wrote:
>>>While moving the global variable from 'environment.c' to 'editor.c'
>>>doesn't cause any behavior change, it still relies on global state.
>>
>>That's true, but does it really make sense for this config setting
>>per-repository? Why would I want to use different editors for
>>different repositories in the same process?
>>
>>Thanks
>>
>>Phillip
>
> In practical sense, yes, it's true. Users generally don't use different
> editors for different repositories. For repository dependent settings
> .editorconfig mostly cover all scenarios.
>
> However, as far as I know git doesn't have a system-wide only
> configuration settings. These changes mostly serve to libification
> process of git. If we leave 'core.editor' setting as a global variable
> and user tries to interact with multiple repositories that have
> different editor configurations using our libified git, it can mix up
> the configs of two repositories.
>
> If we really want to keep these variables independent from repositories,
> we should probably prohibit 'core.editor' setting in local repository
> configs. Otherwise, leaving it global seems like a weird behavioral
> choice.
>
> Thanks,
> Burak Kaan Karaçay

I do agree with the point you're making, true isolation for libification would indeed require that this variable is not a global variable.

But, while libification is the destination, steps in that direction should be welcome, and I think one step is to simply localize the global variables.

Also bloating up `struct repository` without much thought might not be a good decision either.

Previous: Burak Kaan KaraçayNext: Shreyansh Paliwal
Message 7 of 14 in “Remove global state from editor.c”
  1. Shreyansh PaliwalMar 1, 2026
  2. [GSOC][PATCH 1/2] editor: make editor_program local to editor.cShreyansh Paliwal, Mar 1, 2026
  3. Burak Kaan KaraçayMar 1, 2026
  4. Shreyansh PaliwalMar 1, 2026
  5. Phillip WoodMar 1, 2026
  6. Burak Kaan KaraçayMar 1, 2026
  7. Karthik NayakMar 9, 2026
  8. [GSOC][PATCH 2/2] editor: remove the_repository usageShreyansh Paliwal, Mar 1, 2026
  9. Karthik NayakMar 9, 2026
  10. Tian YuchenMar 1, 2026
  11. [GSOC][PATCH v2 0/2] Remove global state from editor.cShreyansh Paliwal, Mar 10, 2026
  12. [GSOC][PATCH v2 1/2] editor: make editor_program local to editor.cShreyansh Paliwal, Mar 10, 2026
  13. [GSOC][PATCH v2 2/2] editor: remove the_repository usageShreyansh Paliwal, Mar 10, 2026
  14. Shreyansh PaliwalMar 17, 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.