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

Re: [GSoC][PATCH v2] merge-strategies.adoc: detail submodule merge

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 21, 2025, 18:07 UTC
Message-ID
<xmqqy0xz9nno.fsf@gitster.g>
In-Reply-To
<70b76a89-00a4-4ba6-92f2-4fb46981317d@free.fr>
Jean-Noël Avila <jn.avila@free.fr> writes:
Show 20 quoted lines
>> @@ -95,6 +102,13 @@ recursive::
>>  	renames.  It does not make use of detected copies.  This was
>>  	the default strategy for resolving two heads from Git v0.99.9k
>>  	until v2.33.0.
>> +
>> +        In the case where the path is a submodule, if the submodule commit
>> +        used on one side of the merge is a descendant of the submodule
>> +        commit used on the other side of the merge, Git attempts to
>> +        fast-forward to the descendant. Otherwise, Git will treat this case
>> +        as a conflict, suggesting as a resolution a submodule commit that
>> +        is descendant of the conflicting ones, if one exists.
>>  +
>>  The 'recursive' strategy takes the same options as 'ort'.  However,
>>  there are three additional options that 'ort' ignores (not documented
>
>
> If both chunks are meant to be kept identical, I would recommend to
> define an attribute (see
> https://docs.asciidoctor.org/asciidoc/latest/attributes/custom-attributes/)
> and use it at both sites.

Wouldn't it be a bit awkward to maintain a six-line paragraph as a custom attribute, though [*1*]? Would the resulting text become like (without indentation) this?

  :submodule-merge: \
  In the case where the path is a submodule, if the submodule commit \
  used on one side of the merge is a descendant of the submodule \
  commit used on the other side of the merge, Git attempts to \
  fast-forward to the descendant. Otherwise, Git will treat this case \
  as a conflict, suggesting as a resolution a submodule commit that \
  is descendant of the conflicting ones, if one exists.
  recursive::
          ...
          the default strategy for resolving two heads from Git v0.99.9k
          until v2.33.0.
  +
  {submodule-merge}
  +
  The 'recursive strategy takes the same options as ...

Just as in C preprocessor macros in *.h files, I am reluctant to force our people to edit long multi-line text while not forgetting to lose the backslash for line continuation (or misplace existing ones when wrapping lines).

And of course a 6-line paragraph is not large enough to put in a separate file to be included.

Hmph...
Thanks.
[Reference]

*1* https://github.com/asciidoctor/asciidoctor/issues/1341#issuecomment-101841014

Previous: Jean-Noël AvilaNext: Lucas Seiki Oshiro
Message 5 of 9 in “merge-strategies.adoc: detail submodule merge”
  1. Lucas Seiki OshiroFeb 20, 2025
  2. D. Ben KnobleFeb 20, 2025
  3. Junio C HamanoFeb 20, 2025
  4. Jean-Noël AvilaFeb 21, 2025
  5. Junio C HamanoFeb 21, 2025
  6. Lucas Seiki OshiroFeb 22, 2025
  7. Junio C HamanoFeb 22, 2025
  8. D. Ben KnobleFeb 24, 2025
  9. Elijah NewrenFeb 21, 2025

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.