From: Junio C Hamano Date: Thu, 22 Apr 2010 00:19:16 GMT Subject: Re: 'git notes merge' implementation questions Message-ID: <7vzl0w730b.fsf@alter.siamese.dyndns.org> In-Reply-To: <201004220208.03706.johan@herland.net> Johan Herland writes: > Next, we will need to be somewhat careful about using "ls-tree", to avoid > needlessly unpacking subtrees that are identical between and > . 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.