diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2008-02-17 19:07:40 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-18 00:10:37 -0800 |
commit | ee95ec5d58d536243966de6ee810d345074b755e (patch) | |
tree | 082c2b30fd7042e81f1e0398d79d829a0d8c4a61 /t/t6023-merge-file.sh | |
parent | f407f14deaa14ebddd0d27238523ced8eca74393 (diff) | |
download | git-ee95ec5d58d536243966de6ee810d345074b755e.tar.gz |
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>
Diffstat (limited to 't/t6023-merge-file.sh')
-rwxr-xr-x | t/t6023-merge-file.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh index 869e8d559e..79dc58b2ce 100755 --- a/t/t6023-merge-file.sh +++ b/t/t6023-merge-file.sh @@ -149,4 +149,14 @@ test_expect_success 'MERGE_ZEALOUS simplifies non-conflicts' ' ' +sed -e 's/deerit./&\n\n\n\n/' -e "s/locavit,/locavit;/" < new6.txt > new8.txt +sed -e 's/deerit./&\n\n\n\n/' -e "s/locavit,/locavit --/" < new7.txt > new9.txt + +test_expect_success 'ZEALOUS_ALNUM' ' + + ! git merge-file -p new8.txt new5.txt new9.txt > merge.out && + test 1 = $(grep ======= < merge.out | wc -l) + +' + test_done |