From: Junio C Hamano Date: Thu, 14 Aug 2008 03:17:02 GMT Subject: Re: [PATCH] Split out merge_recursive() to merge-recursive.c Message-ID: <7vabfggua9.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1218559514-16890-1-git-send-email-vmiklos@frugalware.org> Miklos Vajna writes: > Move most of the of code from builtin-merge-recursive.c to a new file > merge-recursive.c and introduce merge_recursive_setup() in there so that > builtin-merge-recursive and other builtins call it. > > Signed-off-by: Miklos Vajna > --- > > On Mon, Aug 11, 2008 at 04:27:01PM -0700, Junio C Hamano wrote: >> (1) move bulk of code from builtin-merge-recursive.c to a new file >> merge-recursive.c and introduce merge_recursive_helper() in there >> so >> that both of you and cmd_merge_recursive() itself can call it; > > Something like this? Hmm, I think callers except "git merge" implementation should not be even using the "recursive" variant, so in that sense, I do not think you would need to expose anything but merge_trees(). But the new file is called merge-recursive.c not merge-trees.c, and in any case, builtin-merge.c needs to link to the recursive one, so this split is Ok. Exposure of make_virtual_commit() somewhat feels dirty, and I tend to agree that the pure "three-tree merge with rename detection" (aka merge_trees()) should operate on three trees, not commits, though.