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

Re: [PATCH] doc: fix asciidoctor synopsis processing of triple-dots

From
Jean-Noël AVILA <jn.avila@free.fr>
Date
Mar 31, 2025, 20:30 UTC
Message-ID
<5873733.DvuYhMxLoT@cayenne>
In-Reply-To
<Z+rUsCW0zEb8kAK8@szeder.dev>

Le lundi 31 mars 2025, 19:45:20 heure d’été d’Europe centrale SZEDER Gábor a écrit :

Show 35 quoted lines
> On Mon, Mar 31, 2025 at 02:55:51PM +0200, Jean-Noël Avila wrote:
> > The processing of triple dot notation is tricky because it can be
> > mis-interpreted as an ellipsis. The special processing of the ellipsis
> > is now complete and takes into account the case of
> > `git-mv <source>... <dest>`
> > 
> > Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
> > ---
> > 
> >  Documentation/asciidoctor-extensions.rb.in | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/asciidoctor-extensions.rb.in
> > b/Documentation/asciidoctor-extensions.rb.in index 2494f17a51..f2be66c4ad
> > 100644
> > --- a/Documentation/asciidoctor-extensions.rb.in
> > +++ b/Documentation/asciidoctor-extensions.rb.in
> > @@ -49,7 +49,7 @@ module Git
> > 
> >        def process parent, reader, attrs
> >        
> >          outlines = reader.lines.map do |l|
> > 
> > -          l.gsub(/(\.\.\.?)([^\]$.])/, '`\1`\2')
> > +          l.gsub(/(\.\.\.?)([^\]$\. ])/, '{empty}`\1`{empty}\2')
> > 
> >             .gsub(%r{([\[\] |()>]|^)([-a-zA-Z0-9:+=~@,/_^\$]+)},
> >             '\1{empty}`\2`{empty}')
> >             .gsub(/(<[-a-zA-Z0-9.]+>)/, '__\\1__')
> >             .gsub(']', ']{empty}')
> > 
> > @@ -72,6 +72,7 @@ module Git
> > 
> >            %(<inlineequation><alt><![CDATA[#{equation =
> >            node.text}]]></alt><mathphrase><![CDATA[#{equation}]]></
mathphra
Show 8 quoted lines
> >            se></inlineequation>)>          
> >          elsif type == :monospaced
> >          
> >            node.text.gsub(/(\.\.\.?)([^\]$.])/, '<literal>\1</literal>\2')
> > 
> > +                        .gsub(/^\.\.\.?$/, '<literal>\0</literal>\2')
> > 
> >                .gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,/_^\
$]+
> >                \.{0,2})+)}, '\1<literal>\2</literal>')
> >                .gsub(/(&lt;[-a-zA-Z0-9.]+&gt;)/, '<emphasis>\1</
emphasis>')
Show 14 quoted lines
> >          
> >          else
> > 
> > @@ -100,6 +101,7 @@ module Git
> > 
> >        def convert_inline_quoted node
> >        
> >          if node.type == :monospaced
> >          
> >            node.text.gsub(/(\.\.\.?)([^\]$.])/, '<code>\1</code>\2')
> > 
> > +            .gsub(/^\.\.\.?$/, '<code>\0</code>')
> > 
> >                .gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,/_^\
$]+
Show 7 quoted lines
> >                \.{0,2})+)}, '\1<code>\2</code>')
> >                .gsub(/(&lt;[-a-zA-Z0-9.]+&gt;)/, '<em>\1</em>')
> 
> Thanks.  I can confirm that this patch addresses the issue I reported
> with the manpage of 'git diff' (though I think the commit message
> could go into a bit more detail as to what problem this patch attempts
> to solve and how).

These regex are getting a bit too hairy now. I'm working on using a parser generator to clarify how it works (at least for asciidoctor).

> 
> Alas, the issue caused by 'diff-generate-patch.adoc' in the manpages
> of diff-files, diff-index, log, etc. is still present.

Sorry to ready that, but I cannot reproduce on my setup (using asciidoctor 2.0.23):

        2. It is followed by one or more extended header lines (this example 
shows a merge with two parents):
               index <hash>,<hash>..<hash>
               mode <mode>,<mode>..<mode>
               new file mode <mode>
               deleted file mode <mode>,<mode>
Has the format failure changed with this patch?
Thanks
JN
Previous: SZEDER GáborNext: Jean-Noël Avila
Message 54 of 65 in “doc: git diff reformatting”
  1. 0/5 doc: git diff reformattingJean-Noël Avila via GitGitGadget, Aug 4, 2024
  2. 1/5 doc: git-diff: apply new documentation guidelinesJean-Noël Avila via GitGitGadget, Aug 4, 2024
  3. Patrick SteinhardtAug 5, 2024
  4. Jean-Noël AVILAAug 5, 2024
  5. Patrick SteinhardtAug 6, 2024
  6. 3/5 doc: git-diff: apply format changes to diff-formatJean-Noël Avila via GitGitGadget, Aug 4, 2024
  7. 2/5 doc: git-diff: apply format changes to diff-optionsJean-Noël Avila via GitGitGadget, Aug 4, 2024
  8. 4/5 doc: git-diff: apply format changes to diff-generate-patchJean-Noël Avila via GitGitGadget, Aug 4, 2024
  9. Johannes SixtAug 5, 2024
  10. Junio C HamanoAug 5, 2024
  11. Jean-Noël AVILAAug 7, 2024
  12. Johannes SixtAug 12, 2024
  13. Junio C HamanoAug 12, 2024
  14. Jean-Noël AVILAAug 13, 2024
  15. Jean-Noël AVILAAug 5, 2024
  16. 5/5 doc: git-diff: apply format changes to config partJean-Noël Avila via GitGitGadget, Aug 4, 2024
  17. 0/5 doc: git diff reformattingJean-Noël Avila via GitGitGadget, Nov 11, 2024
  18. 1/5 doc: git-diff: apply new documentation guidelinesJean-Noël Avila via GitGitGadget, Nov 11, 2024
  19. Junio C HamanoNov 12, 2024
  20. Jean-Noël AvilaNov 12, 2024
  21. Junio C HamanoNov 12, 2024
  22. Johannes SixtNov 12, 2024
  23. Junio C HamanoNov 12, 2024
  24. Johannes SixtNov 13, 2024
  25. Jean-Noël AvilaNov 13, 2024
  26. 2/5 doc: git-diff: apply format changes to diff-optionsJean-Noël Avila via GitGitGadget, Nov 11, 2024
  27. Junio C HamanoNov 12, 2024
  28. Jean-Noël AvilaNov 12, 2024
  29. Junio C HamanoNov 12, 2024
  30. 4/5 doc: git-diff: apply format changes to diff-generate-patchJean-Noël Avila via GitGitGadget, Nov 11, 2024
  31. 3/5 doc: git-diff: apply format changes to diff-formatJean-Noël Avila via GitGitGadget, Nov 11, 2024
  32. Johannes SixtNov 12, 2024
  33. Junio C HamanoNov 12, 2024
  34. Johannes SixtNov 13, 2024
  35. Jean-Noël AvilaNov 13, 2024
  36. 5/5 doc: git-diff: apply format changes to config partJean-Noël Avila via GitGitGadget, Nov 11, 2024
  37. Johannes SixtNov 12, 2024
  38. Jean-Noël AvilaNov 13, 2024
  39. 0/5 doc: git diff reformattingJean-Noël Avila via GitGitGadget, Nov 16, 2024
  40. 1/5 doc: git-diff: apply new documentation guidelinesJean-Noël Avila via GitGitGadget, Nov 16, 2024
  41. Johannes SixtNov 17, 2024
  42. Jean-Noël AVILANov 17, 2024
  43. Junio C HamanoNov 18, 2024
  44. Junio C HamanoNov 18, 2024
  45. 3/5 doc: git-diff: apply format changes to diff-formatJean-Noël Avila via GitGitGadget, Nov 16, 2024
  46. 2/5 doc: git-diff: apply format changes to diff-optionsJean-Noël Avila via GitGitGadget, Nov 16, 2024
  47. 4/5 doc: git-diff: apply format changes to diff-generate-patchJean-Noël Avila via GitGitGadget, Nov 16, 2024
  48. 5/5 doc: git-diff: apply format changes to config partJean-Noël Avila via GitGitGadget, Nov 16, 2024
  49. 0/5 doc: git diff reformattingJean-Noël Avila via GitGitGadget, Nov 18, 2024
  50. 1/5 doc: git-diff: apply new documentation guidelinesJean-Noël Avila via GitGitGadget, Nov 18, 2024
  51. SZEDER GáborMar 31, 2025
  52. doc: fix asciidoctor synopsis processing of triple-dotsJean-Noël Avila, Mar 31, 2025
  53. SZEDER GáborMar 31, 2025
  54. Jean-Noël AVILAMar 31, 2025
  55. doc: fix asciidoctor synopsis processing of triple-dotsJean-Noël Avila, Apr 1, 2025
  56. Junio C HamanoApr 1, 2025
  57. Jean-Noël AvilaApr 2, 2025
  58. Junio C HamanoApr 7, 2025
  59. 3/5 doc: git-diff: apply format changes to diff-formatJean-Noël Avila via GitGitGadget, Nov 18, 2024
  60. 4/5 doc: git-diff: apply format changes to diff-generate-patchJean-Noël Avila via GitGitGadget, Nov 18, 2024
  61. 2/5 doc: git-diff: apply format changes to diff-optionsJean-Noël Avila via GitGitGadget, Nov 18, 2024
  62. 5/5 doc: git-diff: apply format changes to config partJean-Noël Avila via GitGitGadget, Nov 18, 2024
  63. Junio C HamanoNov 26, 2024
  64. Johannes SixtNov 26, 2024
  65. Junio C HamanoNov 26, 2024

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.