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

Re: [PATCH v6 3/3] vimdiff: add tool documentation

From
Fernando Ramos <greenfoo@u92.eu>
Date
Mar 27, 2022, 21:10 UTC
Message-ID
<YkDS3CJEPYpzRoVG@zacax395.localdomain>
In-Reply-To
<001d3ecd-e1bd-39f4-5123-4a8b1bd1b5a8@gmail.com>
Show 12 quoted lines
> > +mergetool.{n,g,}vimdiff.layout::
> > +	The vimdiff backend uses this variable to control how its split
> > +	windows look like.  See BACKEND SPECIFIC HINTS section of
> > +	linkgit:git-mergetool[1] for details.
> > +
> 
> I generated the man page for 'git-mergetool' and this bit is included in the 
> Configuration section, that's great. However, it feels a little weird to read
> "see BACKEND SPECIFIC HINTS section of linkgit:git-mergetool[1]" there, since
> that's the help page I'm already reading. So maybe it would be nice to use an
> Asciidoc 'ifndef::git-mergetool[]' directive here to hide the "of linkgit:git-mergetool[1]"
> bit if the current page is git-mergetool[1] ?
Good call. I tried this:
    mergetool.{n,g,}vimdiff.layout::
    	The vimdiff backend uses this variable to control how its split
    	windows look like.  See BACKEND SPECIFIC HINTS section
    ifndef::git-mergetool[] 
    	(on linkgit:git-mergetool[1])
    endif::[]
    	for details.
...does it look good?

I'm asking because I ran "make doc" and the generated man page always contains the extra piece. When are those asciidoc directives processed? Should two versions of the same man page be generated?

> This whole section above needs some indentation work to format nicely in Asciidoc/
> Asciidoctor. I've fixed it and will send a 'fixup' patch as a reply.
Thanks! I will include your patch in v7
Show 10 quoted lines
> This is OK, but adds a lot of lines to the output. Maybe we could display the help
> on the same line ? Something like:
> 
> $ ./bin-wrappers/git mergetool --tool-help
> 'git mergetool --tool=<tool>' may be set to one of the following:
> 		emerge
> 		opendiff
> 		vimdiff		Layout can be customized. Run 'git help mergetool' and check the 'BACKEND SPECIFIC HINTS' section.
> 		vimdiff1	Layout can be customized. Run 'git help mergetool' and check the 'BACKEND SPECIFIC HINTS' section.
> 		# etc.

Yes. It looks nicer in one line. In addition, right now it doesn't offer enough information to figure out the difference among variants (vimdiff vs vimdiff1 vs ...) that's why I'm going to update v7 to print something like this following your advice:

    $ ./bin-wrappers/git mergetool --tool-help
    'git mergetool --tool=<tool>' may be set to one of the following:
                    araxis
                    meld
                    vimdiff    Use Vim with a custom layout (see `git help mergetool`'s `BACKEND SPECIFIC HINTS` section).
                    vimdiff1   Use Vim with a 2 panes layout (LOCAL and REMOTE)
                    vimdiff2   Use Vim with a 3 panes layout (LOCAL, MERGED and REMOTE)
                    vimdiff3   Use Vim where only the MERGED file is shown
                    ...
Previous: Philippe BlainNext: Junio C Hamano
Message 11 of 16 in “vimdiff: new implementation with layout support”
  1. 0/3 vimdiff: new implementation with layout supportFernando Ramos, Mar 27, 2022
  2. 1/3 vimdiff: new implementation with layout supportFernando Ramos, Mar 27, 2022
  3. Philippe BlainMar 27, 2022
  4. Fernando RamosMar 27, 2022
  5. Junio C HamanoMar 27, 2022
  6. 2/3 vimdiff: integrate layout tests in the unit tests framework ('t' folder)Fernando Ramos, Mar 27, 2022
  7. Junio C HamanoMar 27, 2022
  8. 3/3 vimdiff: add tool documentationFernando Ramos, Mar 27, 2022
  9. Philippe BlainMar 27, 2022
  10. fixup! vimdiff: add tool documentationPhilippe Blain, Mar 27, 2022
  11. Fernando RamosMar 27, 2022
  12. Junio C HamanoMar 27, 2022
  13. Fernando RamosMar 27, 2022
  14. Bagas SanjayaMar 28, 2022
  15. Junio C HamanoMar 28, 2022
  16. Fernando RamosMar 28, 2022

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.