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

Re: Git Notes Usage

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 8, 2010, 23:20 UTC
Message-ID
<7vhboqjt9b.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4B95652E.6070802@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 6 quoted lines
>> Also, if two people write notes into the same namespace at the
>> same time, how does one merge them?  Is the only way to do so to
>> actually checkout the notes branch into your working directory and
>> merge the notes trees?
>
> I'd say every merge needs a working directory, so, yes.

While that is true in the most general case, I do not necessarily agree that people would use notes that way.

Merging two notes trees would require a lot more than the ordinary merge machinery offers (there is a tree rebalancing logic in notes tree mechanism, and notes specific merge that is yet to be written should take advantage of it) and if one wants to do the merge manually, you would need to check them out in a working tree.

The "notes copy" feature (parked in 'pu') lets you deal with conflicts by allowing you to concatenate (or overwrite) while copying a note for commit Y to another commit X and when X already has a note attached to it. If you think about it, it is merging an old note (that came from emptiness) with a new note (that also came from emptiness) using an emptiness as their common ancestor, i.e. two-tree merge with "union" merge semantics (or "ours" if you say "overwrite", "theirs" if you say "ignore").

I suspect that in practice people would want notes to be resolved more automatically and inclusively (read: union merge) compared to how the normal payload would be merged, without the need to have a checkout in the working tree.

Previous: Michael J Gruber
Message 3 of 3 in “Git Notes Usage”
  1. Scott ChaconMar 8, 2010
  2. Michael J GruberMar 8, 2010
  3. Junio C HamanoMar 8, 2010

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.