On Fri, Jan 29, 2016 at 1:45 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Would it make it simpler to invent a specific value for 'xxx' that > denotes the main worktree (hence $C/worktrees/xxx/config will always > be read by worktrees including the primary one), not to add > $C/common/ anything, and use $C/config as the common one instead? > > Then the repository format version can live in $C/config that would > be noticed by existing versions of Git. I can read this in two ways. In the first way, we still have $C as a .git _directory_ that contains no worktree stuff because those files are in $C/worktrees/main. When we detect .git directory we need to decide if it this is worktree v1 and redirect $GIT_DIR to $C/worktrees/main, otherwise keep $GIT_DIR as $C. This messes up setup code a lot (I tried). The other way, probably a bit deviated from your intention, is, we only support two modes: either all worktrees are in $C/worktrees (multiple worktree mode), or there's only one worktree at .git (single worktree mode). In other words, there's no mixing main and linked worktrees. The user will be forced to convert the main worktree to linked worktree when they want to add a another tree. The backward compatibility issue with worktree v0 is gone. The transition between two modes can be done via "git worktree move". This command can move any worktree, including the main one. Main worktree is converted when it's moved (.git directory remains where it is). "worktree move" can also move repository directory, which also automatically convert main worktree to $C/worktrees/something. If the user deletes all worktrees except one, they can move the repo back to worktree's root, which converts it back to the single worktree mode. Hmm? -- 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