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

Re: 'git notes merge' implementation questions

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 22, 2010, 00:19 UTC
Message-ID
<7vzl0w730b.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201004220208.03706.johan@herland.net>
Johan Herland <johan@herland.net> writes:
> Next, we will need to be somewhat careful about using "ls-tree", to avoid 
> needlessly unpacking subtrees that are identical between <ours> and 
> <theirs>.

My mentioning of "ls-tree" is only about what needs to be done at the conceptual level. In practice, assuming that notes trees have mostly the same fan-out structure, you would run "diff-tree -r" of (base,ours) and (base,theirs) pair _without_ anything fancy like rename detection, and pick out pieces (one tree may have ab/cdx{36} while the other tree may have abcd/x{36} that are notes about the same object---you treat this as if it is a partial ls-tree output that pertains only to the different parts, and make canonical "list of annotated objects" by removing '/'.

All of this is very specific to merging "notes" and normal "merge" does not even want to know about it; I don't think you can avoid doing this yourself without touching "merge" if you want to merge "notes" correctly.

Previous: Johan HerlandNext: Johan Herland
Message 9 of 10 in “'git notes merge' implementation questions”
  1. Johan HerlandApr 21, 2010
  2. Jonathan NiederApr 21, 2010
  3. Johan HerlandApr 21, 2010
  4. Jonathan NiederApr 22, 2010
  5. Junio C HamanoApr 21, 2010
  6. Johan HerlandApr 22, 2010
  7. Junio C HamanoApr 22, 2010
  8. Johan HerlandApr 22, 2010
  9. Junio C HamanoApr 22, 2010
  10. Johan HerlandApr 22, 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.