summaryrefslogtreecommitdiff
path: root/merge-recursive.h
AgeCommit message (Collapse)AuthorFilesLines
2008-09-04merge-recursive: move current_{file,directory}_set to struct merge_optionsLibravatar Miklos Vajna1-0/+4
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
2008-09-04merge-recursive: move the global obuf to struct merge_optionsLibravatar Miklos Vajna1-0/+1
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
2008-09-03merge-recursive: move call_depth to struct merge_optionsLibravatar Miklos Vajna1-0/+1
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
2008-08-30merge-recursive: introduce merge_optionsLibravatar Miklos Vajna1-13/+29
This makes it possible to avoid passing the labels of branches as arguments to merge_recursive(), merge_trees() and merge_recursive_generic(). It also takes care of subtree merge, output buffering, verbosity, and rename limits - these were global variables till now in merge-recursive.c. A new function, named init_merge_options(), is introduced as well, it clears the struct merge_info, then initializes with default values, finally updates the default values based on the config and environment variables. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-30merge-recursive.c: Add more generic merge_recursive_generic()Libravatar Stephan Beyer1-1/+3
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(). This patch also rewrites builtin-merge-recursive.c to make use of merge_recursive_generic(). By doing this, I stumbled over the limitation of 20 bases and I've added a warning if this limitation is exceeded. This patch qualifies make_virtual_commit() as static again because this function is not needed anymore outside merge-recursive.c. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-30Split out merge_recursive() to merge-recursive.cLibravatar Miklos Vajna1-1/+5
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 <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-09Build-in merge-recursiveLibravatar Daniel Barkalow1-0/+20
This makes write_tree_from_memory(), which writes the active cache as a tree and returns the struct tree for it, available to other code. It also makes available merge_trees(), which does the internal merge of two trees with a known base, and merge_recursive(), which does the recursive internal merge of two commits with a list of common ancestors. The first two of these will be used by checkout -m, and the third is presumably useful in general, although the implementation of checkout -m which entirely matches the behavior of the shell version does not use it (since it ignores the difference of ancestry between the old branch and the new branch). Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>