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

Re: [PATCH v2] config.c: split some variables to $GIT_DIR/config.worktree

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 29, 2015, 01:25 UTC
Message-ID
<CACsJy8DqgX91KYd5m3PvYSTXYdCO8YV-5R+v6LnzerS6TOr+5A@mail.gmail.com>
In-Reply-To
<20150326221906.GA6745@wheezy.local>
On Fri, Mar 27, 2015 at 5:19 AM, Max Kirillov <max@max630.net> wrote:
Show 15 quoted lines
> On Thu, Mar 26, 2015 at 07:04:24PM +0700, Nguyễn Thái Ngọc Duy wrote:
>> When you define $GIT_DIR/info/config.worktree, which contains of
>> gitignore-style patterns (*), config variables that match these
>> patterns will be saved in $GIT_DIR/config.worktree instead of
>> $GIT_DIR/config.
>
> Should it rather be in GIT_COMMON_DIR? As far as I
> understand, its meaning is "variables which we allow to use
> per-worktree because we intend to have them different in
> different worktrees, and sure no bad issues
> can happen because this. It is not hardcored in git because
> the list is going to extend, and we'd like to allow older
> versions of git (and other git implementations) to be still
> able to understand newer repositories". So there should be
> no sense to make the list worktree-specific.

I'm not sure if "it" means $GIT_DIR/config.worktree or $GIT_DIR/info/config.worktree. At this point $GIT_COMMON_DIR is not involved (i.e. you can still spit config even in a normal repo). .../info/config.worktree may be shared, I guess.

The "older versions of git (and other git implementations)" raises an issue with this patch. Older impl just ignore config.worktree. I think I need to bump core.repositoryformatversion up to avoid that.

Show 9 quoted lines
> Also, probably the per-worktree variables should be searched
> for in both common config and per-worktree config, and the
> main repository should not have config.worktree, to be able
> to work with implementations which are not aware of the
> whole multiple worktrees feature. And in worktrees, if the
> variable is not defined in config.wortree, the default
> vaalue should come from common config. This though has
> downside that worktree cannot use the more global vlue for
> variable implicitly.

The main worktree may or may not use per-worktree config (it's technically possible): if we enforce config.worktree on the main worktree, we don't have to worry about the same variable defined in both common and per-worktree config. Enforcing may require more work: imagine the worktree list is updated, some in the common config may become per-worktree and need to be moved to config.worktree.. If we allow per-worktree vars in the common config, other worktrees should ignore them in common config.

-- 
Duy
Previous: Max KirillovNext: Max Kirillov
Message 12 of 22 in “worktree.* config keys and submodule and multiple worktrees”
  1. 0/3 worktree.* config keys and submodule and multiple worktreesNguyễn Thái Ngọc Duy, Feb 8, 2015
  2. 1/3 config.c: new config namespace worktree.* stored in $GIT_DIR/config.worktreeNguyễn Thái Ngọc Duy, Feb 8, 2015
  3. 2/3 setup: add worktree.path to shadow core.worktreeNguyễn Thái Ngọc Duy, Feb 8, 2015
  4. 3/3 submodule: use worktree.path instead of core.worktreeNguyễn Thái Ngọc Duy, Feb 8, 2015
  5. Jens LehmannFeb 8, 2015
  6. Jens LehmannFeb 8, 2015
  7. Duy NguyenFeb 9, 2015
  8. per-repository and per-worktree config variablesMax Kirillov, Mar 18, 2015
  9. Duy NguyenMar 24, 2015
  10. config.c: split some variables to $GIT_DIR/config.worktreeNguyễn Thái Ngọc Duy, Mar 26, 2015
  11. Max KirillovMar 26, 2015
  12. Duy NguyenMar 29, 2015
  13. Max KirillovMar 30, 2015
  14. config.c: split some variables to $GIT_DIR/config.worktreeNguyễn Thái Ngọc Duy, Mar 31, 2015
  15. Duy NguyenMar 31, 2015
  16. Max KirillovApr 1, 2015
  17. Duy NguyenApr 3, 2015
  18. Max KirillovApr 13, 2015
  19. Duy NguyenApr 18, 2015
  20. Max KirillovApr 20, 2015
  21. Duy NguyenApr 20, 2015
  22. Jens LehmannMar 25, 2015

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.