From f01de62e4591a6acc061eb994d44f7eeef7a0cfd Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sat, 20 Mar 2010 19:38:58 -0500 Subject: ll_merge(): add ancestor label parameter for diff3-style output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commands using the ll_merge() function will present conflict hunks imitating ‘diff3 -m’ output if the merge.conflictstyle configuration option is set appropriately. Unlike ‘diff3 -m’, the output does not include a label for the merge base on the ||||||| line of the output, and some tools misparse the conflict hunks without that. Add a new ancestor_label parameter to ll_merge() to give callers the power to rectify this situation. If ancestor_label is NULL, the output format is unchanged. All callers pass NULL for now. Requested-by: Stefan Monnier Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- rerere.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rerere.c') diff --git a/rerere.c b/rerere.c index a59f74f76c..f221bed1e9 100644 --- a/rerere.c +++ b/rerere.c @@ -319,7 +319,7 @@ static int handle_cache(const char *path, unsigned char *sha1, const char *outpu if (!mmfile[i].ptr && !mmfile[i].size) mmfile[i].ptr = xstrdup(""); } - ll_merge(&result, path, &mmfile[0], + ll_merge(&result, path, &mmfile[0], NULL, &mmfile[1], "ours", &mmfile[2], "theirs", 0); for (i = 0; i < 3; i++) @@ -376,7 +376,7 @@ static int merge(const char *name, const char *path) ret = 1; goto out; } - ret = ll_merge(&result, path, &base, &cur, "", &other, "", 0); + ret = ll_merge(&result, path, &base, NULL, &cur, "", &other, "", 0); if (!ret) { FILE *f = fopen(path, "w"); if (!f) -- cgit v1.2.3