conflict markers in markdown files

2 messages, 2 authors, 2021-10-28 · open the first message on its own page

conflict markers in markdown files

From: Nicholas Bransby-Williams <hidden>
Date: 2021-10-28 14:00:43

Isn't it quite unfortunate that markdown chose setext-style headers by
“underlining” with equal signs (=) meaning if a header is 7 characters
long it's going to clash with the git conflicts markers (example
below).

Would it make sense to add an option to merge-file so merge tools can
specify a custom marker that is statistically much less likely to
clash with the kinds of text files that are typically stored in git
repositories?

cat ./ours.md
A Second Level Header
---------------------
Ours
=======
Its ours
The quick brown fox jumped over the lazy
dog's back.

cat ./base.md
A Second Level Header
---------------------
The quick brown fox jumped over the lazy
dog's back.

cat ./theirs.md
A Second Level Header
---------------------
Theirs
=======
Its theirs
The quick brown fox jumped over the lazy
dog's back.

git merge-file -p ./ours.md ./base.md ./theirs.md
A Second Level Header
---------------------
<<<<<<< ./ours.md
Ours
=======
Its ours
=======
Theirs
=======
Its theirs
quoted
quoted
quoted
quoted
quoted
quoted
./theirs.md
The quick brown fox jumped over the lazy
dog's back.

Re: conflict markers in markdown files

From: Philip Oakley <hidden>
Date: 2021-10-28 15:38:56

On 28/10/2021 15:00, Nicholas Bransby-Williams wrote:
Isn't it quite unfortunate that markdown chose setext-style headers by
“underlining” with equal signs (=) meaning if a header is 7 characters
long it's going to clash with the git conflicts markers (example
below).

Would it make sense to add an option to merge-file so merge tools can
specify a custom marker that is statistically much less likely to
clash with the kinds of text files that are typically stored in git
repositories?

cat ./ours.md
A Second Level Header
---------------------
Ours
=======
Its ours
The quick brown fox jumped over the lazy
dog's back.

cat ./base.md
A Second Level Header
---------------------
The quick brown fox jumped over the lazy
dog's back.

cat ./theirs.md
A Second Level Header
---------------------
Theirs
=======
Its theirs
The quick brown fox jumped over the lazy
dog's back.

git merge-file -p ./ours.md ./base.md ./theirs.md
A Second Level Header
---------------------
<<<<<<< ./ours.md
Ours
=======
Its ours
=======
Theirs
=======
Its theirs
quoted
quoted
quoted
quoted
quoted
quoted
quoted
./theirs.md
In a similar vein, the above `>>>>>>> ./theirs.md` is being formatted as
repeated side bars in Thunderbird. But that's someone else's problem ;-)
The quick brown fox jumped over the lazy
dog's back.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help