git/list[1] front-page[2] threads[3] people[4] search[5] about
 

conflict markers in markdown files

From
Nicholas Bransby-Williams <nbransby@gmail.com>
Date
Oct 28, 2021, 14:00 UTC
Message-ID
<CAGyLXMBWyfcBVFDRbYJMk+-RjjNBQDvoDeaBtEPiXpUDDTqfOA@mail.gmail.com>

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

>>>>>>> ./theirs.md

The quick brown fox jumped over the lazy dog's back.

Next: Philip Oakley
Message 1 of 9 in “conflict markers in markdown files”
  1. Nicholas Bransby-WilliamsOct 28, 2021
  2. Philip OakleyOct 28, 2021
  3. Junio C HamanoOct 28, 2021
  4. Nicholas Bransby-WilliamsOct 28, 2021
  5. Junio C HamanoOct 28, 2021
  6. Nicholas Bransby-WilliamsOct 28, 2021
  7. Junio C HamanoOct 28, 2021
  8. rsbecker@nexbridge.comOct 28, 2021
  9. Junio C HamanoOct 29, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.