Re: [PATCH v3 6/6] worktree add: switch to worktree version 1
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Feb 1, 2016, 06:05 UTC
- Message-ID
- <CACsJy8Am7rQ=pm0C7bw0gQ=aic3opmBos+3+1Awrko8TT2uHrg@mail.gmail.com>
- In-Reply-To
- <20160201053333.GE4978@wheezy.local>
On Mon, Feb 1, 2016 at 12:33 PM, Max Kirillov <max@max630.net> wrote:
Show 18 quoted lines
> On Tue, Jan 26, 2016 at 06:44:45PM +0700, Nguyễn Thái Ngọc Duy wrote:
>> + for (key_p = per_wortree_keys; *key_p; key_p++) {
>> + const char *key = *key_p;
>> + char *value = get_key(sb.buf, key);
>> +
>> + if (value) {
>> + if (git_config_set(key, value))
>> + die(_("failed to keep %s in main worktree's config file"), key);
>> + if (git_config_set_in_file(sb.buf, key, NULL))
>> + die(_("failed to delete %s in shared config file"), key);
>> + free(value);
>> + }
>> + }
>
> 1. For submodules (which must be left per-worktree) this
> approach is not going to work, because you don't know all
> variables in advance. You could scan the config file and
> match those actual keys which are there with patterns.Hmm.. we could keep existing submodule.* per-worktree. New variables are per-worktree by default, unless you do "git config --repo" in git-submodule.sh. Am I missing something?
> 2. This migrates variables to the default (or current?) > worktree, what about others existing?
In v0, $C/config contains all shared variables, once we move these shared vars to $C/common/config, they will be visible to all other worktrees. Or do you replicate per-worktree vars in $C/config to all worktrees ?
-- Duy