On Fri, Mar 27, 2015 at 5:19 AM, Max Kirillov <max@xxxxxxxxxx> wrote: > On Thu, Mar 26, 2015 at 07:04:24PM +0700, Nguyễn Thái Ngọc Duy wrote: >> When you define $GIT_DIR/info/config.worktree, which contains of >> gitignore-style patterns (*), config variables that match these >> patterns will be saved in $GIT_DIR/config.worktree instead of >> $GIT_DIR/config. > > Should it rather be in GIT_COMMON_DIR? As far as I > understand, its meaning is "variables which we allow to use > per-worktree because we intend to have them different in > different worktrees, and sure no bad issues > can happen because this. It is not hardcored in git because > the list is going to extend, and we'd like to allow older > versions of git (and other git implementations) to be still > able to understand newer repositories". So there should be > no sense to make the list worktree-specific. I'm not sure if "it" means $GIT_DIR/config.worktree or $GIT_DIR/info/config.worktree. At this point $GIT_COMMON_DIR is not involved (i.e. you can still spit config even in a normal repo). .../info/config.worktree may be shared, I guess. The "older versions of git (and other git implementations)" raises an issue with this patch. Older impl just ignore config.worktree. I think I need to bump core.repositoryformatversion up to avoid that. > Also, probably the per-worktree variables should be searched > for in both common config and per-worktree config, and the > main repository should not have config.worktree, to be able > to work with implementations which are not aware of the > whole multiple worktrees feature. And in worktrees, if the > variable is not defined in config.wortree, the default > vaalue should come from common config. This though has > downside that worktree cannot use the more global vlue for > variable implicitly. The main worktree may or may not use per-worktree config (it's technically possible): if we enforce config.worktree on the main worktree, we don't have to worry about the same variable defined in both common and per-worktree config. Enforcing may require more work: imagine the worktree list is updated, some in the common config may become per-worktree and need to be moved to config.worktree.. If we allow per-worktree vars in the common config, other worktrees should ignore them in common config. -- 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