git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] notes: handle multiple worktrees

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 3, 2015, 13:27 UTC
Message-ID
<CACsJy8B-HV8NS_FCuoy3pvLRr4B7S4CGO4StNxXaB=WLt8=94w@mail.gmail.com>
In-Reply-To
<CALKQrgcX2aPc4cac2p-w8FE9K7X+A5tFWtNcS-N6EOC9gTvfZw@mail.gmail.com>
On Wed, Jul 29, 2015 at 5:50 AM, Johan Herland <johan@herland.net> wrote:
Show 29 quoted lines
> On Wed, Jul 29, 2015 at 12:12 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> 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.
I agree. Luckily sharing NOTES_MERGE_REF is as short as
diff --git a/path.c b/path.c
index 10f4cbf..52d8ee4 100644
--- a/path.c
+++ b/path.c
@@ -94,7 +94,7 @@ static void replace_dir(struct strbuf *buf, int len,
const char *newdir)
 static const char *common_list[] = {
  "/branches", "/hooks", "/info", "!/logs", "/lost-found",
  "/objects", "/refs", "/remotes", "/worktrees", "/rr-cache", "/svn",
- "config", "!gc.pid", "packed-refs", "shallow",
+ "config", "!gc.pid", "packed-refs", "shallow", "NOTES_MERGE_REF",
  NULL
 };
 --
Duy
Previous: Johan HerlandNext: Eric Sunshine
Message 12 of 41 in “pseudorefs”
  1. 0/6 pseudorefsDavid Turner, Jul 28, 2015
  2. 1/6 refs: Introduce pseudoref and per-worktree ref conceptsDavid Turner, Jul 28, 2015
  3. 2/6 notes: replace pseudorefs with real refsDavid Turner, Jul 28, 2015
  4. Junio C HamanoJul 28, 2015
  5. David TurnerJul 28, 2015
  6. Junio C HamanoJul 28, 2015
  7. notes: handle multiple worktreesDavid Turner, Jul 28, 2015
  8. David TurnerJul 28, 2015
  9. Junio C HamanoJul 28, 2015
  10. Junio C HamanoJul 28, 2015
  11. Johan HerlandJul 28, 2015
  12. Duy NguyenAug 3, 2015
  13. Eric SunshineJul 28, 2015
  14. Johan HerlandJul 28, 2015
  15. Junio C HamanoJul 28, 2015
  16. Johan HerlandJul 28, 2015
  17. Junio C HamanoJul 29, 2015
  18. Michael HaggertyJul 29, 2015
  19. Jacob KellerJul 29, 2015
  20. Johan HerlandJul 29, 2015
  21. Junio C HamanoJul 29, 2015
  22. Junio C HamanoJul 29, 2015
  23. Johan HerlandJul 29, 2015
  24. Junio C HamanoJul 29, 2015
  25. Johan HerlandJul 29, 2015
  26. Junio C HamanoJul 29, 2015
  27. Johan HerlandJul 29, 2015
  28. Junio C HamanoJul 29, 2015
  29. Junio C HamanoJul 29, 2015
  30. Johan HerlandJul 30, 2015
  31. Junio C HamanoJul 30, 2015
  32. Junio C HamanoJul 29, 2015
  33. Johan HerlandJul 29, 2015
  34. 3/6 refs: add ref_type functionDavid Turner, Jul 28, 2015
  35. Eric SunshineJul 29, 2015
  36. 4/6 pseudorefs: create and use pseudoref update and delete functionsDavid Turner, Jul 28, 2015
  37. Eric SunshineJul 29, 2015
  38. 5/6 rebase: use update_refDavid Turner, Jul 28, 2015
  39. 6/6 sequencer: replace write_cherry_pick_head with update_refDavid Turner, Jul 28, 2015
  40. Junio C HamanoJul 28, 2015
  41. David TurnerJul 28, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.