Thread (4 messages) flat view 4 messages, 3 authors, 2016-08-13

Re: git-core: conflictstyle=diff3 doesn't actually use diff3 compatible format

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:24

Bert Wesarg [off-list ref] writes:
rerere needs an isspace() after the specified marker length. So I
assume it could live with extra cruft after the | marker and a space.
is_cmarker() is called with want_sp = 0 for '=======' and '|||||||', so
the current code accepts both "||||||| rubbish\n" and "|||||||\n".

Also, rerere sanitizes a diff3 style conflict into a merge style conflict
before writing a preimage to rr-cache for later comparison [*1*], so it
probably is Ok even if we changed it in a way that it no longer reads the
current output without " rubbish" after the marker.  It appears that it is
already prepared to take either form, so we are probably safe here.

But I didn't check subcommands other than rerere that may read and act on
the conflict markers.
BTW: Am I right, that rerere would need to handle my new conflict style too?
If we were to change the output, git needs to be prepared to see both the
output before and after the change and behave sensibly; it is not limited
to rerere.

For the reverse combined diff format, rerere probably needs to be taught
how to convert it as merge style conflict before computing the conflict
identifier and write it out in the preimage file, I think.

[Footnote]

*1* See 387c9d4 (rerere: understand "diff3 -m" style conflicts with the
original, 2008-08-29).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help