From 8a161433a0b414d15093e312eb9be99587074309 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sat, 20 Mar 2010 19:31:44 -0500 Subject: xdl_merge(): add optional ancestor label to diff3-style output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ‘git checkout --conflict=diff3’ command can be used to present conflicts hunks including text from the common ancestor: <<<<<<< ours ourside ||||||| original ======= theirside >>>>>>> theirs The added information is helpful for resolving merges by hand, and merge tools can usually grok it because it is very similar to the output from diff3 -m. A subtle change can help more tools to understand the output. ‘diff3’ includes the name of the merge base on the ||||||| line of the output, and some tools misparse the conflict hunks without it. Add a new xmp->ancestor parameter to xdl_merge() for use with conflict style XDL_MERGE_DIFF3 as a label on the ||||||| line for any conflict hunks. If xmp->ancestor is NULL, the output format is unchanged. Thus, this change only provides unexposed plumbing for the new feature; it does not affect the outward behavior of git. Requested-by: Stefan Monnier Signed-off-by: Jonathan Nieder Acked-by: Bert Wesarg Signed-off-by: Junio C Hamano --- xdiff/xdiff.h | 1 + 1 file changed, 1 insertion(+) (limited to 'xdiff/xdiff.h') diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h index a71763ade8..6eb5fffde1 100644 --- a/xdiff/xdiff.h +++ b/xdiff/xdiff.h @@ -117,6 +117,7 @@ typedef struct s_xmparam { int level; int favor; int style; + const char *ancestor; /* label for orig */ } xmparam_t; #define DEFAULT_CONFLICT_MARKER_SIZE 7 -- cgit v1.2.3