Re: [PATCH v3 6/6] worktree add: switch to worktree version 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 1, 2016 at 12:33 PM, Max Kirillov <max@xxxxxxxxxx> wrote:
> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]