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

Re: conflict markers in markdown files

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 28, 2021, 19:54 UTC
Message-ID
<xmqq5ytgrkku.fsf@gitster.g>
In-Reply-To
<CAGyLXMBWyfcBVFDRbYJMk+-RjjNBQDvoDeaBtEPiXpUDDTqfOA@mail.gmail.com>
Nicholas Bransby-Williams <nbransby@gmail.com> writes:
> 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?
Is the conflict-marker-size attribute sufficient?  If not, why?

In our documentation, we do need to have literal runs of '<<<', '===', etc. to illustrate and describe the conflict markers, so we have these in .gitattributes at the top-level:

    /Documentation/git-merge.txt conflict-marker-size=32
    /Documentation/gitk.txt conflict-marker-size=32
    /Documentation/user-manual.txt conflict-marker-size=32

so that the auto-inserted conflict markers will be very long, instead of just the default (was it 7? I do not remember offhand because I do not have to). Most importantly, these "32" are written by folks who wrote these documentation pages and *knew* that there is no runs of '<', '=', '|' or '>' that are 32 letters long, so it is safe and can be updated to stay safe when the documentation files change.

Previous: Philip OakleyNext: Nicholas Bransby-Williams
Message 3 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.