On Wed, May 02, 2018 at 08:20:54AM +0200, Martin Ågren wrote: > On 2 May 2018 at 06:50, Junio C Hamano <gitster@xxxxxxxxx> wrote: > > Martin Ågren <martin.agren@xxxxxxxxx> writes: > > > >> The diagram renders fine in AsciiDoc before and after this patch. > >> Asciidoctor, on the other hand, ignores the tabs entirely, which results > >> in different indentation for different lines. The graph illustration > >> earlier in the document already uses spaces instead of a tab. > > > > Ouch. We might want to teach Documentation/.gitattributes that > > indent-with-tab is unwelcome in that directory, after making this > > fix (and possibly similar ones to other files). > > I actually grepped around a little for a leading tab, to see if I could > immediately spot any similar issues. But there are tons of tabs here > (about 13000). Most of them work out just fine, e.g., in the OPTIONS, > where we tab-indent the descriptions. > > So while we could try to move away from leading tabs in Documentation/, > it would be a huge undertaking. Any kind of "do it while we're nearby" > approach would take a long time to complete. And a one-off conversion > would probably be a horrible idea. ;-) > > I just noticed another difference in how the tabs are handled. In > git-add.txt, which I just picked at random, the three continuation lines > in the synopsis indent differently in AsciiDoc (which indents them more > than in the .txt) and Asciidoctor (which indents them less than in the > .txt). To me, this is more of a "if I didn't sit down and compare the > two outputs, I would never think about these indentations -- they're > both fine". > > So it might be that the only places where leading tabs really matter is > this kind of diagrams. Maybe we have a handful such bugs lingering among > the 13000 tab-indented lines... I took a look at this. Asciidoctor does seem to have some weird ideas about tabs, but I think how it's handling this is converting them to spaces, which makes sense if you're working with HTML or XML (which do some bizarre things with tabs). However, it's not converting them to 8 spaces, which is really what we want here. We can help both AsciiDoc and Asciidoctor do the right thing here (and keep our 8-space tabs) by enclosing the diagram in a block like so: [literal] -- Args Expanded arguments Selected commits D G H D D F G H I J D F ^G D H D ^D B E I J F B ^D B C E I J F B C C I J F C B..C = ^B C C B...C = B ^F C G H D E B C B^- = B^..B = ^B^1 B E I J F B C^@ = C^1 = F I J F B^@ = B^1 B^2 B^3 = D E F D G H E F I J C^! = C ^C^@ = C ^C^1 = C ^F C B^! = B ^B^@ = B ^B^1 ^B^2 ^B^3 = B ^D ^E ^F B F^! D = F ^I ^J D G H D F -- and using the tabsize=8 attribute when invoking Asciidoctor. I can send a patch tomorrow which does this, which I think may be a bit nicer than having to give up tabs. Thoughts? -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204
Attachment:
signature.asc
Description: PGP signature