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

Re: conflict markers in markdown files

From
Philip Oakley <philipoakley@iee.email>
Date
Oct 28, 2021, 15:38 UTC
Message-ID
<9561c0de-fb97-093b-4615-6d6d7d595d51@iee.email>
In-Reply-To
<CAGyLXMBWyfcBVFDRbYJMk+-RjjNBQDvoDeaBtEPiXpUDDTqfOA@mail.gmail.com>
On 28/10/2021 15:00, Nicholas Bransby-Williams wrote:
Show 46 quoted lines
> 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

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.
Previous: Nicholas Bransby-WilliamsNext: Junio C Hamano
Message 2 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.