Re: [PATCH] notes: handle multiple worktrees
- From
Johan Herland <johan@herland.net>
- Date
- Jul 28, 2015, 22:50 UTC
- Message-ID
- <CALKQrgcX2aPc4cac2p-w8FE9K7X+A5tFWtNcS-N6EOC9gTvfZw@mail.gmail.com>
- In-Reply-To
- <xmqqtwsoaq45.fsf@gitster.dls.corp.google.com>
On Wed, Jul 29, 2015 at 12:12 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
> David Turner <dturner@twopensource.com> writes: >> Prevent merges to the same notes branch from different worktrees. >> Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using the same >> code we use to check that two HEADs in different worktrees don't point >> to the same branch. Modify that code, die_if_checked_out, to take a >> "head" ref to examine; previously, it just looked at HEAD. >> >> Reported-by: Junio C Hamano <gitster@pobox.com> >> Signed-off-by: David Turner <dturner@twopensource.com> >> --- > > Thanks for following through. As I didn't report anything, I do not > deserve that label, but it's OK ;-) > > I know that it is a requirement to protect NOTES_MERGE_REF from > being used by multiple places for "notes merge" to play well with > the multi-worktree world order, but because I do not know if that is > sufficient, I'm asking a few people for further review.
As just stated in a related thread, I don't think it makes sense to have NOTES_MERGE_REF per worktree, as the notes merge is always completely unrelated to the current worktree (or the current branch for that matter). AFAICS this patch is all about handling per-worktree NOTES_MERGE_REFs, and as such I'm NAK on this patch. Instead, there should only be one NOTES_MERGE_REF per _repo_, and although we might want to expand to allow multiple concurrent notes merges in the future, that is still a per-repo, and not a per-worktree thing, hence completely unrelated to David's current effort.
...Johan