From bc4caecf9557c765951897d8483b1514ebae74bf Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Tue, 28 Aug 2018 22:27:43 +0100 Subject: [PATCH 1/2] rerere: mention caveat about unmatched conflict markers 4af3220 ("rerere: teach rerere to handle nested conflicts", 2018-08-05) introduced slightly better behaviour if the user commits conflict markers and then gets another conflict in 'git rerere'. However this is just a heuristic to punt on such conflicts better, and doesn't deal with any unmatched conflict markers. Make that clearer in the documentation. Suggested-by: Junio C Hamano Signed-off-by: Thomas Gummerer Signed-off-by: Junio C Hamano --- Documentation/technical/rerere.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/technical/rerere.txt b/Documentation/technical/rerere.txt index e65ba9b0c6..aa22d7ace8 100644 --- a/Documentation/technical/rerere.txt +++ b/Documentation/technical/rerere.txt @@ -149,6 +149,10 @@ version, and the sorting the conflict hunks, both for the outer and the inner conflict. This is done recursively, so any number of nested conflicts can be handled. +Note that this only works for conflict markers that "cleanly nest". If +there are any unmatched conflict markers, rerere will fail to handle +the conflict and record a conflict resolution. + The only difference is in how the conflict ID is calculated. For the inner conflict, the conflict markers themselves are not stripped out before calculating the sha1. From f427869bde759e32c30e8ba7a4b20837d3806642 Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Tue, 28 Aug 2018 22:27:44 +0100 Subject: [PATCH 2/2] rerere: add note about files with existing conflict markers When a file contains lines that look like conflict markers, 'git rerere' may fail not be able to record a conflict resolution. Emphasize that in the man page, and mention a possible workaround for the issue. Suggested-by: Junio C Hamano Signed-off-by: Thomas Gummerer Signed-off-by: Junio C Hamano --- Documentation/git-rerere.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt index 031f31fa47..df310d2a58 100644 --- a/Documentation/git-rerere.txt +++ b/Documentation/git-rerere.txt @@ -211,6 +211,12 @@ would conflict the same way as the test merge you resolved earlier. 'git rerere' will be run by 'git rebase' to help you resolve this conflict. +[NOTE] 'git rerere' relies on the conflict markers in the file to +detect the conflict. If the file already contains lines that look the +same as lines with conflict markers, 'git rerere' may fail to record a +conflict resolution. To work around this, the `conflict-marker-size` +setting in linkgit:gitattributes[5] can be used. + GIT --- Part of the linkgit:git[1] suite