Re: [PATCH v3 2/8] Add a place for (not) sharing stuff between worktrees
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 22, 2018, 04:28 UTC
- Message-ID
- <xmqqin1uwqo6.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20181021080859.3203-3-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> Subject: Re: [PATCH v3 2/8] Add a place for (not) sharing stuff between worktrees
"a place"? Missing "in $GIR_DIR" in the descrition made me read the above three times before getting what it wanted to say.
My attempt to improve it, which admittedly is not great, came up with:
worktree: convention to make per-worktree things identifiable in $GIT_DIR
Show 15 quoted lines
> When multiple worktrees are used, we need rules to determine if > something belongs to one worktree or all of them. Instead of keeping > adding rules when new stuff comes (*), have a generic rule: > > - Inside $GIT_DIR, which is per-worktree by default, add > $GIT_DIR/common which is always shared. New features that want to > share stuff should put stuff under this directory. > > - Inside refs/, which is shared by default except refs/bisect, add > refs/worktree/ which is per-worktree. We may eventually move > refs/bisect to this new location and remove the exception in refs > code. > > (*) And it may also include stuff from external commands which will > have no way to modify common/per-worktree rules.
OK. Establishing such a convention is a good role for the core-git should play to help third-party tools.
Should this play well with the per-worktree configuration as well? Is it better to carve out a configuration variable namespace so that certain keys are never read from common ones (or per-worktree ones), so that people can tell which ones are what? I know your current design says "this is just another new layer, and the users can hang themselves with this new rope". I am wondering if there is a need to do something a bit more structured.