4af32207bc
Currently rerere can't handle nested conflicts and will error out when it encounters such conflicts. Do that by recursively calling the 'handle_conflict' function to normalize the conflict. Note that a conflict like this would only be produced if a user commits a file with conflict markers, and gets a conflict including that in a susbsequent operation. The conflict ID calculation here deserves some explanation: As we are using the same handle_conflict function, the nested conflict is normalized the same way as for non-nested conflicts, which means the ancestor in the diff3 case is stripped out, and the parts of the conflict are ordered alphabetically. The conflict ID is however is only calculated in the top level handle_conflict call, so it will include the markers that 'rerere' adds to the output. e.g. say there's the following conflict: <<<<<<< HEAD 1 ======= <<<<<<< HEAD 3 ======= 2 >>>>>>> branch-2 >>>>>>> branch-3~ it would be recorde as follows in the preimage: <<<<<<< 1 ======= <<<<<<< 2 ======= 3 >>>>>>> >>>>>>> and the conflict ID would be calculated as sha1(1<NUL><<<<<<< 2 ======= 3 >>>>>>><NUL>) Stripping out vs. leaving the conflict markers in place in the inner conflict should have no practical impact, but it simplifies the implementation. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
---|---|---|
.. | ||
.gitignore | ||
api-allocation-growing.txt | ||
api-argv-array.txt | ||
api-config.txt | ||
api-credentials.txt | ||
api-diff.txt | ||
api-directory-listing.txt | ||
api-error-handling.txt | ||
api-gitattributes.txt | ||
api-grep.txt | ||
api-history-graph.txt | ||
api-index-skel.txt | ||
api-index.sh | ||
api-merge.txt | ||
api-object-access.txt | ||
api-oid-array.txt | ||
api-parse-options.txt | ||
api-quote.txt | ||
api-ref-iteration.txt | ||
api-remote.txt | ||
api-revision-walking.txt | ||
api-run-command.txt | ||
api-setup.txt | ||
api-sigchain.txt | ||
api-submodule-config.txt | ||
api-trace.txt | ||
api-tree-walking.txt | ||
api-xdiff-interface.txt | ||
bitmap-format.txt | ||
commit-graph-format.txt | ||
commit-graph.txt | ||
hash-function-transition.txt | ||
http-protocol.txt | ||
index-format.txt | ||
long-running-process-protocol.txt | ||
pack-format.txt | ||
pack-heuristics.txt | ||
pack-protocol.txt | ||
partial-clone.txt | ||
protocol-capabilities.txt | ||
protocol-common.txt | ||
protocol-v2.txt | ||
racy-git.txt | ||
repository-version.txt | ||
rerere.txt | ||
send-pack-pipeline.txt | ||
shallow.txt | ||
signature-format.txt | ||
trivial-merge.txt |