Thread (13 messages) flat view 13 messages, 4 authors, 2016-06-15

Re: [PATCH (1b)] merge-recursive.c: Add more generic merge_recursive_generic()

From: Stephan Beyer <hidden>
Date: 2016-06-15 22:45:09

Possibly related (same subject, not in this thread)

Hi,

Miklos Vajna wrote:
On Tue, Aug 12, 2008 at 10:13:59PM +0200, Stephan Beyer [off-list ref] wrote:
quoted
merge_recursive_generic() takes, in comparison to to merge_recursive(),
no commit ("struct commit *") arguments but SHA ids ("unsigned char *"),
and no commit list of bases but an array of refs ("const char **").

This makes it more generic in the case that it can also take the SHA
of a tree to merge trees without commits, for the bases, the head
and the remote.

merge_recursive_generic() also handles locking and updating of the
index, which is a common use case of merge_recursive().
Then what about adding an extra parameter to merge_recursive_generic()
so that merge_recursive_setup() could be a static function?
Could it?

I did not intend to replace merge_recursive() by merge_recursive_generic(),
because merge_recursive() may be the better choice in cases where the caller
only deals with commit objects and never with tree objects directly.
Or if the caller does not want to lock the index or do some other stuff
with the index...
In that case merge_recursive_setup() is still needed, isn't it?

Regards,
  Stephan

-- 
Stephan Beyer [off-list ref], PGP 0x6EDDD207FCC5040F

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help