On Thu, Jan 28, 2016 at 5:22 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote: >> With this patch, since worktree v1, the repo config file (or worktree >> config file in multi worktree context) is no longer shared. Main >> worktree reads $C/config. Linked worktrees read $C/worktrees/xxx/config >> and a new file, $C/worktrees/config. Sharing is done via this new >> file. The read hierarchy for a worktree becomes >> >> 1) system config >> 2) XDG config >> 3) user config >> 4) $C/common/config >> 5) $C/worktrees/xxx/config (or $C/config for main worktree) >> >> Compare to an alternative scheme where $C/config contains both shared >> variables and main-worktree-only ones, this is a cleaner design. >> >> * We do not have to check every single variable name to see if it's >> shared or per-worktree when reading config files. >> >> * We do not enforce any particular variable split. If a variable >> is in $C/worktrees/config, it is shared. Putting core.worktree in >> $C/worktrees/config is punished the same way the variable is put in >> $HOME/.gitconfig, for example. >> >> * We will provide a new "git config --repo" to access this new config >> file. In single-worktree context, or worktree v0, --repo is an alias >> of --local. >> >> There is one problem though. We store worktree version in config file >> and expect that all worktrees must share the same version (i.e. read >> the same config file). But the share-ness of per-repo config files is >> changed based on worktree version. Where do we put extensions.worktree >> then? > > I cannot see why it cannot live in $C/common/config, which would be > read as the fourth alternative in your earlier enumeration. What I > am missing? I wasn't clear. The last paragraph is about already released git binaries, which does not care about $C/common/config. Suppose you add a new worktree with new git binary, which will move common stuff out of .git/config to common/config, on a shared repo. If the old binary reads that repo, it does not see common config, but it does not know where common config is either. -- 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