]> granicus.if.org Git - git/commit
config: add --move-to
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 27 Dec 2018 15:56:11 +0000 (16:56 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Jan 2019 21:40:24 +0000 (13:40 -0800)
commit6f11fd5edb6cd0ba2fc7bd9ce81587758c2a5700
tree706057eecdd7191de3db72bbd879b597deeaaee2
parenta12c1ff3a57b70116ea887cfac84b0d6f20c9e72
config: add --move-to

This option can be used to move one or multiple variables from one
place to another, e.g. to move some aliases from repo config to user
config, or from repo config to per-worktree config.

This will be useful for moving config variables around when
extensions.worktreeConfig is enabled. E.g.

    git config --local --move-to --worktree core.worktree
    git config --local --move-glob-to --worktree 'submodule.*.*'

The implementation is definitely not the best. We could for example
lock both source and destination files before doing any update, and
perhaps edit these files just once instead of once per key.

But it adds a lot more complication to config update code. Let's stay
with something simple for now. It's not worse than scripting using
"git config". Optimization could be done later.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-config.txt
Documentation/git-worktree.txt
builtin/config.c
t/t1300-config.sh