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

[PATCH 0/6] Add "git config --move-to"

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Dec 27, 2018, 15:56 UTC
Message-ID
<20181227155611.10585-1-pclouds@gmail.com>

This is a continuation of nd/per-worktree-config, fixing is small things from that series and prepares to make submodules work in multiple worktrees.

The first thing is adding API for updating per-worktree config in 03/06. When submodule code wants to write to a per-worktree config, calling this function takes care of both single and multi worktree setups, similar to "git config --worktree <name> <value>"

The second thing is "git config --move-to" and friends. This helps the config transition right after enabling extensions.worktreeConfig, when the user has to make sure per-worktree config stays in per-worktree file.

Manual moving config from one file to another is possible with a couple keys like core.worktree, but once you have to move multiple groups (i.e. "submodule.*.*" keys) then it becomes a lot less fun and more pain. This simplifies that work (and also migration documentation)

Note that I added --move-glob-to because I think glob fits much better than regex for matching keys because of the dots in config keys. I added --move-regex-to anyway because we have --get-regexp. Maybe I should add --get-glob too (but probably not now).

There is also a NEEDSWORK in 03/06. But I hope it could be addressed after this series is merged (so that I could continue pushing submodule changes out)

Nguyễn Thái Ngọc Duy (6):
  config.c: avoid git_path() in do_git_config_sequence()
  worktree.c: add get_worktree_config()
  config.c: add repo_config_set_worktree_gently()
  config: use OPT_FILENAME()
  config: factor out set_config_source_file()
  config: add --move-to
 Documentation/git-config.txt   |  12 ++
 Documentation/git-worktree.txt |  16 ++-
 builtin/config.c               | 244 ++++++++++++++++++++++++---------
 config.c                       |  55 +++++++-
 config.h                       |   3 +
 t/t1300-config.sh              |  54 ++++++++
 worktree.c                     |  16 +++
 worktree.h                     |   7 +
 8 files changed, 330 insertions(+), 77 deletions(-)
-- 
2.20.0.482.g66447595a7
Next: Nguyễn Thái Ngọc Duy
Message 1 of 12 in “Add "git config --move-to"”
  1. 0/6 Add "git config --move-to"Nguyễn Thái Ngọc Duy, Dec 27, 2018
  2. 1/6 config.c: avoid git_path() in do_git_config_sequence()Nguyễn Thái Ngọc Duy, Dec 27, 2018
  3. Junio C HamanoJan 10, 2019
  4. 2/6 worktree.c: add get_worktree_config()Nguyễn Thái Ngọc Duy, Dec 27, 2018
  5. Eric SunshineDec 27, 2018
  6. 3/6 config.c: add repo_config_set_worktree_gently()Nguyễn Thái Ngọc Duy, Dec 27, 2018
  7. Derrick StoleeApr 30, 2019
  8. Duy NguyenMay 1, 2019
  9. 4/6 config: use OPT_FILENAME()Nguyễn Thái Ngọc Duy, Dec 27, 2018
  10. Eric SunshineDec 27, 2018
  11. 5/6 config: factor out set_config_source_file()Nguyễn Thái Ngọc Duy, Dec 27, 2018
  12. 6/6 config: add --move-toNguyễn Thái Ngọc Duy, Dec 27, 2018

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.