Re: [PATCH] revisions.txt: expand tabs to spaces in diagram

2018-05-03 Thread Junio C Hamano
"brian m. carlson"  writes:

> ...  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 argumentsSelected commits
>DG H D
>D F  G H I J D F
>...
> = 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.

Yeah, trying to forbid indent-with-tab has been shown to be
unworkable so even if we tried to give up tabs, it is likely we
would break it by mistake.  Allowing indent-with-tab and ask the
tool to do the right thing is obviously the right direction.

Thanks.


Re: [PATCH] revisions.txt: expand tabs to spaces in diagram

2018-05-03 Thread brian m. carlson
On Wed, May 02, 2018 at 08:20:54AM +0200, Martin Ågren wrote:
> On 2 May 2018 at 06:50, Junio C Hamano  wrote:
> > Martin Ågren  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 argumentsSelected commits
   DG 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
   CI J F C
   B..C   = ^B CC
   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 ^FC
   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


signature.asc
Description: PGP signature


Re: [PATCH] revisions.txt: expand tabs to spaces in diagram

2018-05-02 Thread Martin Ågren
On 2 May 2018 at 06:50, Junio C Hamano  wrote:
> Martin Ågren  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...

Martin


Re: [PATCH] revisions.txt: expand tabs to spaces in diagram

2018-05-01 Thread Junio C Hamano
Martin Ågren  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).


[PATCH] revisions.txt: expand tabs to spaces in diagram

2018-04-30 Thread Martin Ågren
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.

Signed-off-by: Martin Ågren 
---
Can be seen at the end of https://git-scm.com/docs/gitrevisions

 Documentation/revisions.txt | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index dfcc49c72c..011746b74f 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -355,15 +355,15 @@ spelt out:
B..C   = ^B CC
B...C  = B ^F C  G H D E B C
B^-= B^..B
- = ^B^1 B  E I J F B
+  = ^B^1 B  E I J F B
C^@= C^1
- = F   I J F
+  = F   I J F
B^@= B^1 B^2 B^3
- = D E F   D G H E F I J
+  = D E F   D G H E F I J
C^!= C ^C^@
- = C ^C^1
- = C ^FC
+  = C ^C^1
+  = C ^FC
B^!= B ^B^@
- = B ^B^1 ^B^2 ^B^3
- = B ^D ^E ^F  B
+  = B ^B^1 ^B^2 ^B^3
+  = B ^D ^E ^F  B
F^! D  = F ^I ^J D   G H D F
-- 
2.17.0