xdl_merge(): introduce XDL_MERGE_ZEALOUS_ALNUM
commitee95ec5d58d536243966de6ee810d345074b755e
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Sun, 17 Feb 2008 19:07:40 +0000 (17 19:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Feb 2008 08:10:37 +0000 (18 00:10 -0800)
tree082c2b30fd7042e81f1e0398d79d829a0d8c4a61
parentf407f14deaa14ebddd0d27238523ced8eca74393
xdl_merge(): introduce XDL_MERGE_ZEALOUS_ALNUM

When a merge conflicts, there are often common lines that are not really
common, such as empty lines or lines containing a single curly bracket.

With XDL_MERGE_ZEALOUS_ALNUM, we use the following heuristics: when a
hunk does not contain any letters or digits, it is treated as conflicting.

In other words, a conflict which used to look like this:

<<<<<<<
a = 1;
=======
output();
>>>>>>>
}
}
}

<<<<<<<
output();
=======
b = 1;
>>>>>>>

will look like this with ZEALOUS_ALNUM:

<<<<<<<
a = 1;
}
}
}

output();
=======
output();
}
}
}

b = 1;
>>>>>>>

To demonstrate this, git-merge-file has been switched from
XDL_MERGE_ZEALOUS to XDL_MERGE_ZEALOUS_ALNUM.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-merge-file.c
t/t6023-merge-file.sh
xdiff/xdiff.h
xdiff/xmerge.c