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

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 29, 2015, 02:25 UTC
Message-ID
<xmqq8u9zbsy5.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CALKQrgeevWUE6tdPLWRKzRQLj5v5_9NyFqJCBraRArrZB-QNyw@mail.gmail.com>
Johan Herland <johan@herland.net> writes:
Show 8 quoted lines
> Yes, almost. There are some complications with the concept of
> "checking out" a notes tree:
>
>  - The notes tree fanout must be flattened (so that when merging two
> note trees with different fanout, conflicting notes (e.g. deadbeef...
> and de/adbeef....) are turned into a file-level conflict in the notes
> merge worktree (i.e. contents with conflict markers in
> .git/NOTES_MERGE_WORKTREE/deadbeef...).

True. I however think Michael was envisioning further into the future, where the tree-level merges would take care of that detail and populate the index to express conflicts using "canonicalised" paths, removing these fan-out slashes, before externalising the conflicted paths that need user's attention on the filesystem.

>  - Notes trees may be very large (e.g. one note per commit for the
> entire project history), so we want to avoid checking out as many
> notes as possible. Currently we only checkout the notes that actually
> do conflict, and keep the rest referenced from NOTES_MERGE_PARTIAL.

This is a valid point, but nobody forces us to do a full checkout to perform a merge. From day one, our merge machinery is prepared to merge in an empty working tree, only checking out paths that need to be modified by the merge.

Show 14 quoted lines
>> * This would allow multiple notes merges to take place at the same time
>> provided they target different merge references.
>>
>> * This would prevent multiple notes merges to the same notes reference
>> at the same time by the same mechanism that prevents the same branch
>> from being checked out in two linked worktrees at the same time.
>>
>> It's just a thought; I have no idea whether it is practical...
>
> I'm not sure whether it's worth trying to reuse the same linked
> worktree mechanism for notes trees, when (a) the concept of "checking
> out" a notes tree is so different, as explained above, and (b)
> currently the only use case for a notes worktree is during a notes
> merge.

I have a very similar feeling except that I'd replace "linked worktree mechanism" with "checkout mechanism". If we were to introduce such a new checkout mechanism that flattens a fan-out paths, with "sparse checkout"-like behaviour, the current "checkout mechanism" would not be reused, but the resulting system would benefit from "linked worktree mechanism" just as much as the normal multiple worktree layout benefits from it. You'd want to make sure only one such worktree has the checkout of one refs/notes/* ref, everything in refs/* is shared across the repository and its worktrees, and certain things like MERGE_HEAD and the index inside $GIT_DIR/ are not shared, which are what the linked worktree mechanism gives us.

Previous: Johan HerlandNext: Junio C Hamano
Message 21 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.