git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/4] A few Asciidoctor-fixes
@ 2018-12-15 11:27 Martin Ågren
  2018-12-15 11:27 ` [PATCH 1/4] git-column.txt: fix section header Martin Ågren
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Martin Ågren @ 2018-12-15 11:27 UTC (permalink / raw)
  To: git

I have (ab)used doc-diff to try to find instances where Asciidoctor and
Asciidoc render our documentation differently. (See [1] for details on
the hack.) This series fixes the differences that somehow stood out in
the diff. Many smaller differences remain.

With each patch, I am giving one or a few URLs which show the current
Asciidoctor rendering at git-scm.com.

With Asciidoc, `doc-diff origin/master HEAD` reports that there is no
difference.

[1] https://public-inbox.org/git/CAN0heSob+Ac4BvM-vuKvPZKxrTW53-d91a55NX5kC7ZyNXntWQ@mail.gmail.com/

Martin Ågren (4):
  git-column.txt: fix section header
  git-init.txt: do not nest open blocks
  rev-list-options.txt: do not nest open blocks
  git-status.txt: render tables correctly under Asciidoctor

 Documentation/git-column.txt       |   2 +-
 Documentation/git-init.txt         |   4 -
 Documentation/git-status.txt       | 162 +++++++++++++++--------------
 Documentation/rev-list-options.txt |   4 -
 4 files changed, 86 insertions(+), 86 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/4] git-column.txt: fix section header
  2018-12-15 11:27 [PATCH 0/4] A few Asciidoctor-fixes Martin Ågren
@ 2018-12-15 11:27 ` Martin Ågren
  2018-12-16 10:51   ` Jeff King
  2018-12-15 11:27 ` [PATCH 2/4] git-init.txt: do not nest open blocks Martin Ågren
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Martin Ågren @ 2018-12-15 11:27 UTC (permalink / raw)
  To: git

We have too few dashes under "Examples", which causes Asciidoctor to not
pick it up as a section header, but to instead just render the dashes
literally. This also seems to confuse Asciidoctor about dashes in
general around here. It misinterprets the listing blocks in this
section, again rendering the dashes literally.

Make sure we have as many dashes as we have characters in "Examples".
This fixes the section-issue and, somehow, makes the listing blocks
render correctly.

Asciidoc renders identically before and after this patch, both man-page
and html.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 See https://git-scm.com/docs/git-column

 Documentation/git-column.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git-column.txt b/Documentation/git-column.txt
index 763afabb6d..f58e9c43e6 100644
--- a/Documentation/git-column.txt
+++ b/Documentation/git-column.txt
@@ -47,7 +47,7 @@ OPTIONS
 	The number of spaces between columns. One space by default.
 
 EXAMPLES
-------
+--------
 
 Format data by columns:
 ------------
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/4] git-init.txt: do not nest open blocks
  2018-12-15 11:27 [PATCH 0/4] A few Asciidoctor-fixes Martin Ågren
  2018-12-15 11:27 ` [PATCH 1/4] git-column.txt: fix section header Martin Ågren
@ 2018-12-15 11:27 ` Martin Ågren
  2018-12-16 10:55   ` Jeff King
  2018-12-15 11:27 ` [PATCH 3/4] rev-list-options.txt: " Martin Ågren
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Martin Ågren @ 2018-12-15 11:27 UTC (permalink / raw)
  To: git

It appears we try to nest open blocks, but that does not work well with
Asciidoctor, which fails to indent the inner block. This causes the
inner block to be set as if it had nothing to do with `--shared`. Drop
the outer one. Asciidoc renders identically before and after this patch,
both man-page and html.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 See https://git-scm.com/docs/git-init#git-init---sharedfalsetrueumaskgroupallworldeverybody0xxx

 Documentation/git-init.txt | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index 3c5a67fb96..057076ca38 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -38,8 +38,6 @@ the repository to another place if --separate-git-dir is given).
 OPTIONS
 -------
 
---
-
 -q::
 --quiet::
 
@@ -111,8 +109,6 @@ into it.
 If you provide a 'directory', the command is run inside it. If this directory
 does not exist, it will be created.
 
---
-
 TEMPLATE DIRECTORY
 ------------------
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/4] rev-list-options.txt: do not nest open blocks
  2018-12-15 11:27 [PATCH 0/4] A few Asciidoctor-fixes Martin Ågren
  2018-12-15 11:27 ` [PATCH 1/4] git-column.txt: fix section header Martin Ågren
  2018-12-15 11:27 ` [PATCH 2/4] git-init.txt: do not nest open blocks Martin Ågren
@ 2018-12-15 11:27 ` Martin Ågren
  2018-12-16 10:56   ` Jeff King
  2018-12-15 11:27 ` [PATCH 4/4] git-status.txt: render tables correctly under Asciidoctor Martin Ågren
  2018-12-16 10:44 ` [PATCH 0/4] " Jeff King
  4 siblings, 1 reply; 18+ messages in thread
From: Martin Ågren @ 2018-12-15 11:27 UTC (permalink / raw)
  To: git

Similar to the previous commit, it appears we try to nest open blocks,
which does not work well with Asciidoctor. Drop the outer one. That
fixes the indentation similar to the previous patch, and makes us stop
rendering a literal '+' before "Under --pretty=oneline ...". Asciidoc
renders identically before and after this patch, both man-page and html.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 See https://git-scm.com/docs/git-log#git-log--g and
 https://git-scm.com/docs/git-rev-list#git-rev-list--g . The indentation
 doesn't look too bad, but the "+ Under" is clearly wrong.

 Documentation/rev-list-options.txt | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index bab5f50b17..98b538bc77 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -13,8 +13,6 @@ has a line that matches `<pattern>`), unless otherwise noted.
 Note that these are applied before commit
 ordering and formatting options, such as `--reverse`.
 
---
-
 -<number>::
 -n <number>::
 --max-count=<number>::
@@ -308,8 +306,6 @@ ifdef::git-rev-list[]
 	`<header>` text will be printed with each progress update.
 endif::git-rev-list[]
 
---
-
 History Simplification
 ~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/4] git-status.txt: render tables correctly under Asciidoctor
  2018-12-15 11:27 [PATCH 0/4] A few Asciidoctor-fixes Martin Ågren
                   ` (2 preceding siblings ...)
  2018-12-15 11:27 ` [PATCH 3/4] rev-list-options.txt: " Martin Ågren
@ 2018-12-15 11:27 ` Martin Ågren
  2018-12-16 10:59   ` Jeff King
  2018-12-16 10:44 ` [PATCH 0/4] " Jeff King
  4 siblings, 1 reply; 18+ messages in thread
From: Martin Ågren @ 2018-12-15 11:27 UTC (permalink / raw)
  To: git

Asciidoctor removes the indentation of each line in these tables, so the
last lines of each table have a completely broken alignment.

Similar to 379805051d ("Documentation: render revisions correctly under
Asciidoctor", 2018-05-06), use an explicit literal block to indicate
that we want to keep the leading whitespace in the tables.

Because this gives us some extra indentation, we can remove the one that
we have been carrying explicitly. That is, drop the first four spaces of
indentation on each line. With Asciidoc (8.6.10), this results in
identical rendering before and after this commit, both for git-status.1
and git-status.html.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 See https://git-scm.com/docs/git-status#_short_format ,
 https://git-scm.com/docs/git-status#_branch_headers and
 https://git-scm.com/docs/git-status#_changed_tracked_entries .

 Documentation/git-status.txt | 162 ++++++++++++++++++-----------------
 1 file changed, 85 insertions(+), 77 deletions(-)

diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index d9f422d560..861d821d7f 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -197,31 +197,33 @@ codes can be interpreted as follows:
 Ignored files are not listed, unless `--ignored` option is in effect,
 in which case `XY` are `!!`.
 
-    X          Y     Meaning
-    -------------------------------------------------
-	     [AMD]   not updated
-    M        [ MD]   updated in index
-    A        [ MD]   added to index
-    D                deleted from index
-    R        [ MD]   renamed in index
-    C        [ MD]   copied in index
-    [MARC]           index and work tree matches
-    [ MARC]     M    work tree changed since index
-    [ MARC]     D    deleted in work tree
-    [ D]        R    renamed in work tree
-    [ D]        C    copied in work tree
-    -------------------------------------------------
-    D           D    unmerged, both deleted
-    A           U    unmerged, added by us
-    U           D    unmerged, deleted by them
-    U           A    unmerged, added by them
-    D           U    unmerged, deleted by us
-    A           A    unmerged, both added
-    U           U    unmerged, both modified
-    -------------------------------------------------
-    ?           ?    untracked
-    !           !    ignored
-    -------------------------------------------------
+....
+X          Y     Meaning
+-------------------------------------------------
+	 [AMD]   not updated
+M        [ MD]   updated in index
+A        [ MD]   added to index
+D                deleted from index
+R        [ MD]   renamed in index
+C        [ MD]   copied in index
+[MARC]           index and work tree matches
+[ MARC]     M    work tree changed since index
+[ MARC]     D    deleted in work tree
+[ D]        R    renamed in work tree
+[ D]        C    copied in work tree
+-------------------------------------------------
+D           D    unmerged, both deleted
+A           U    unmerged, added by us
+U           D    unmerged, deleted by them
+U           A    unmerged, added by them
+D           U    unmerged, deleted by us
+A           A    unmerged, both added
+U           U    unmerged, both modified
+-------------------------------------------------
+?           ?    untracked
+!           !    ignored
+-------------------------------------------------
+....
 
 Submodules have more state and instead report
 		M    the submodule has a different HEAD than
@@ -281,14 +283,16 @@ don't recognize.
 If `--branch` is given, a series of header lines are printed with
 information about the current branch.
 
-    Line                                     Notes
-    ------------------------------------------------------------
-    # branch.oid <commit> | (initial)        Current commit.
-    # branch.head <branch> | (detached)      Current branch.
-    # branch.upstream <upstream_branch>      If upstream is set.
-    # branch.ab +<ahead> -<behind>           If upstream is set and
-					     the commit is present.
-    ------------------------------------------------------------
+....
+Line                                     Notes
+------------------------------------------------------------
+# branch.oid <commit> | (initial)        Current commit.
+# branch.head <branch> | (detached)      Current branch.
+# branch.upstream <upstream_branch>      If upstream is set.
+# branch.ab +<ahead> -<behind>           If upstream is set and
+					 the commit is present.
+------------------------------------------------------------
+....
 
 ### Changed Tracked Entries
 
@@ -306,56 +310,60 @@ Renamed or copied entries have the following format:
 
     2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
 
-    Field       Meaning
-    --------------------------------------------------------
-    <XY>        A 2 character field containing the staged and
-		unstaged XY values described in the short format,
-		with unchanged indicated by a "." rather than
-		a space.
-    <sub>       A 4 character field describing the submodule state.
-		"N..." when the entry is not a submodule.
-		"S<c><m><u>" when the entry is a submodule.
-		<c> is "C" if the commit changed; otherwise ".".
-		<m> is "M" if it has tracked changes; otherwise ".".
-		<u> is "U" if there are untracked changes; otherwise ".".
-    <mH>        The octal file mode in HEAD.
-    <mI>        The octal file mode in the index.
-    <mW>        The octal file mode in the worktree.
-    <hH>        The object name in HEAD.
-    <hI>        The object name in the index.
-    <X><score>  The rename or copy score (denoting the percentage
-		of similarity between the source and target of the
-		move or copy). For example "R100" or "C75".
-    <path>      The pathname.  In a renamed/copied entry, this
-		is the target path.
-    <sep>       When the `-z` option is used, the 2 pathnames are separated
-		with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)
-		byte separates them.
-    <origPath>  The pathname in the commit at HEAD or in the index.
-		This is only present in a renamed/copied entry, and
-		tells where the renamed/copied contents came from.
-    --------------------------------------------------------
+....
+Field       Meaning
+--------------------------------------------------------
+<XY>        A 2 character field containing the staged and
+	    unstaged XY values described in the short format,
+	    with unchanged indicated by a "." rather than
+	    a space.
+<sub>       A 4 character field describing the submodule state.
+	    "N..." when the entry is not a submodule.
+	    "S<c><m><u>" when the entry is a submodule.
+	    <c> is "C" if the commit changed; otherwise ".".
+	    <m> is "M" if it has tracked changes; otherwise ".".
+	    <u> is "U" if there are untracked changes; otherwise ".".
+<mH>        The octal file mode in HEAD.
+<mI>        The octal file mode in the index.
+<mW>        The octal file mode in the worktree.
+<hH>        The object name in HEAD.
+<hI>        The object name in the index.
+<X><score>  The rename or copy score (denoting the percentage
+	    of similarity between the source and target of the
+	    move or copy). For example "R100" or "C75".
+<path>      The pathname.  In a renamed/copied entry, this
+	    is the target path.
+<sep>       When the `-z` option is used, the 2 pathnames are separated
+	    with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)
+	    byte separates them.
+<origPath>  The pathname in the commit at HEAD or in the index.
+	    This is only present in a renamed/copied entry, and
+	    tells where the renamed/copied contents came from.
+--------------------------------------------------------
+....
 
 Unmerged entries have the following format; the first character is
 a "u" to distinguish from ordinary changed entries.
 
     u <xy> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>
 
-    Field       Meaning
-    --------------------------------------------------------
-    <XY>        A 2 character field describing the conflict type
-		as described in the short format.
-    <sub>       A 4 character field describing the submodule state
-		as described above.
-    <m1>        The octal file mode in stage 1.
-    <m2>        The octal file mode in stage 2.
-    <m3>        The octal file mode in stage 3.
-    <mW>        The octal file mode in the worktree.
-    <h1>        The object name in stage 1.
-    <h2>        The object name in stage 2.
-    <h3>        The object name in stage 3.
-    <path>      The pathname.
-    --------------------------------------------------------
+....
+Field       Meaning
+--------------------------------------------------------
+<XY>        A 2 character field describing the conflict type
+	    as described in the short format.
+<sub>       A 4 character field describing the submodule state
+	    as described above.
+<m1>        The octal file mode in stage 1.
+<m2>        The octal file mode in stage 2.
+<m3>        The octal file mode in stage 3.
+<mW>        The octal file mode in the worktree.
+<h1>        The object name in stage 1.
+<h2>        The object name in stage 2.
+<h3>        The object name in stage 3.
+<path>      The pathname.
+--------------------------------------------------------
+....
 
 ### Other Items
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/4] A few Asciidoctor-fixes
  2018-12-15 11:27 [PATCH 0/4] A few Asciidoctor-fixes Martin Ågren
                   ` (3 preceding siblings ...)
  2018-12-15 11:27 ` [PATCH 4/4] git-status.txt: render tables correctly under Asciidoctor Martin Ågren
@ 2018-12-16 10:44 ` Jeff King
  2018-12-16 14:34   ` Martin Ågren
  4 siblings, 1 reply; 18+ messages in thread
From: Jeff King @ 2018-12-16 10:44 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git

On Sat, Dec 15, 2018 at 12:27:38PM +0100, Martin Ågren wrote:

> I have (ab)used doc-diff to try to find instances where Asciidoctor and
> Asciidoc render our documentation differently. (See [1] for details on
> the hack.) This series fixes the differences that somehow stood out in
> the diff. Many smaller differences remain.

I think the relevant bits from [1] are:

 * Use `make --always-make ... install-man` in doc-diff.
 * ./doc-diff -f HEAD HEAD # note -f
 * Add empty commit and tweak config.mak
 * ./doc-diff HEAD^ HEAD # note no -f

To make this easier, it would make sense to me to:

  - teach doc-diff a flag for marking one or both of the endpoints to be
    built with asciidoctor versus asciidoc

  - mark the asciidoc/asciidoctor in the directory name. That name
    serves as a cache key for avoiding re-doing the work, you should be
    able to just:

      ./doc-diff --asciidoctor HEAD HEAD

    and actually build and compare what you want.

  - it sounds from "make --always-make" that our Makefile does not
    properly rebuild when we switch from asciidoc to asciidoctor. That
    might be nice to fix with a mechanism similar to the GIT-BUILD-FLAGS
    we use in the top-level Makefile.

-Peff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/4] git-column.txt: fix section header
  2018-12-15 11:27 ` [PATCH 1/4] git-column.txt: fix section header Martin Ågren
@ 2018-12-16 10:51   ` Jeff King
  2018-12-16 14:27     ` Martin Ågren
  0 siblings, 1 reply; 18+ messages in thread
From: Jeff King @ 2018-12-16 10:51 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git

On Sat, Dec 15, 2018 at 12:27:39PM +0100, Martin Ågren wrote:

> We have too few dashes under "Examples", which causes Asciidoctor to not
> pick it up as a section header, but to instead just render the dashes
> literally. This also seems to confuse Asciidoctor about dashes in
> general around here. It misinterprets the listing blocks in this
> section, again rendering the dashes literally.
> 
> Make sure we have as many dashes as we have characters in "Examples".
> This fixes the section-issue and, somehow, makes the listing blocks
> render correctly.

Yeah, the mis-matched title-and-dashes thing has bitten us several
times. I think this one just post-dates the last round of fixing.

The "somehow" here is that the mismatched dashes appear to be the start
of a code listing block, making the whole example section into one big
listing (which isn't properly closed, generating a warning).

And that's why in the context:

>  EXAMPLES
> -------
> +--------
>  
>  Format data by columns:
>  ------------

We _don't_ need to match up the dashes for "Format data...". That is
meant to be a listing block (and arguably should use a shorter string of
dashes to make that intent more obvious).

-Peff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/4] git-init.txt: do not nest open blocks
  2018-12-15 11:27 ` [PATCH 2/4] git-init.txt: do not nest open blocks Martin Ågren
@ 2018-12-16 10:55   ` Jeff King
  0 siblings, 0 replies; 18+ messages in thread
From: Jeff King @ 2018-12-16 10:55 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git

On Sat, Dec 15, 2018 at 12:27:40PM +0100, Martin Ågren wrote:

> It appears we try to nest open blocks, but that does not work well with
> Asciidoctor, which fails to indent the inner block. This causes the
> inner block to be set as if it had nothing to do with `--shared`. Drop
> the outer one. Asciidoc renders identically before and after this patch,
> both man-page and html.

Hrm. I'm not sure how we're supposed to have a block-within-a-block in
asciidoctor, and that may be something we want to fix in the long run.
But I agree this block around all of the options is not doing anything
useful, and the simplest solution here is just to get rid of it.

It dates all the way back to d145144c3b (Document git-init, 2007-01-11),
so perhaps it did something useful in an ancient version of asciidoc.

-Peff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/4] rev-list-options.txt: do not nest open blocks
  2018-12-15 11:27 ` [PATCH 3/4] rev-list-options.txt: " Martin Ågren
@ 2018-12-16 10:56   ` Jeff King
  0 siblings, 0 replies; 18+ messages in thread
From: Jeff King @ 2018-12-16 10:56 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git

On Sat, Dec 15, 2018 at 12:27:41PM +0100, Martin Ågren wrote:

> Similar to the previous commit, it appears we try to nest open blocks,
> which does not work well with Asciidoctor. Drop the outer one. That
> fixes the indentation similar to the previous patch, and makes us stop
> rendering a literal '+' before "Under --pretty=oneline ...". Asciidoc
> renders identically before and after this patch, both man-page and html.

Makes sense. Arguably this could be squashed into the previous one,
since the rationale is completely the same (but I'm OK with it either
way).

-Peff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] git-status.txt: render tables correctly under Asciidoctor
  2018-12-15 11:27 ` [PATCH 4/4] git-status.txt: render tables correctly under Asciidoctor Martin Ågren
@ 2018-12-16 10:59   ` Jeff King
  2018-12-16 14:28     ` [PATCH v2 0/3] A few Asciidoctor-fixes Martin Ågren
  0 siblings, 1 reply; 18+ messages in thread
From: Jeff King @ 2018-12-16 10:59 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git

On Sat, Dec 15, 2018 at 12:27:42PM +0100, Martin Ågren wrote:

> Asciidoctor removes the indentation of each line in these tables, so the
> last lines of each table have a completely broken alignment.
> 
> Similar to 379805051d ("Documentation: render revisions correctly under
> Asciidoctor", 2018-05-06), use an explicit literal block to indicate
> that we want to keep the leading whitespace in the tables.
> 
> Because this gives us some extra indentation, we can remove the one that
> we have been carrying explicitly. That is, drop the first four spaces of
> indentation on each line. With Asciidoc (8.6.10), this results in
> identical rendering before and after this commit, both for git-status.1
> and git-status.html.

Yep, this makes sense based on the prior art you cited.

The whole series looks good to me. Thanks for working on it!

-Peff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/4] git-column.txt: fix section header
  2018-12-16 10:51   ` Jeff King
@ 2018-12-16 14:27     ` Martin Ågren
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Ågren @ 2018-12-16 14:27 UTC (permalink / raw)
  To: Jeff King; +Cc: Git Mailing List

On Sun, 16 Dec 2018 at 11:51, Jeff King <peff@peff.net> wrote:
>
> On Sat, Dec 15, 2018 at 12:27:39PM +0100, Martin Ågren wrote:
>
> > We have too few dashes under "Examples", which causes Asciidoctor to not
> > pick it up as a section header, but to instead just render the dashes
> > literally. This also seems to confuse Asciidoctor about dashes in
> > general around here. It misinterprets the listing blocks in this
> > section, again rendering the dashes literally.
> >
> > Make sure we have as many dashes as we have characters in "Examples".
> > This fixes the section-issue and, somehow, makes the listing blocks
> > render correctly.
>
> The "somehow" here is that the mismatched dashes appear to be the start
> of a code listing block, making the whole example section into one big
> listing (which isn't properly closed, generating a warning).

Of course. Thanks for pointing it out. I now realize that when I wrote
"render the dashes literally", I was wrong.

This should be improved in v2.

Martin

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 0/3] A few Asciidoctor-fixes
  2018-12-16 10:59   ` Jeff King
@ 2018-12-16 14:28     ` Martin Ågren
  2018-12-16 14:28       ` [PATCH v2 1/3] git-column.txt: fix section header Martin Ågren
                         ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Martin Ågren @ 2018-12-16 14:28 UTC (permalink / raw)
  To: git; +Cc: Jeff King

This series addresses a few instances where our documentation renders
badly in Asciidoctor, compared to Asciidoc. The changes made are exactly
the same as in v1 [1], but the first commit message is corrected, and
the two patches 2/4 and 3/4 are now just a single patch 2/3.

Thanks Peff for your comments on v1.

[1] https://public-inbox.org/git/20181215112742.1475882-1-martin.agren@gmail.com/

Martin Ågren (3):
  git-column.txt: fix section header
  Documentation: do not nest open blocks
  git-status.txt: render tables correctly under Asciidoctor

 Documentation/git-column.txt       |   2 +-
 Documentation/git-init.txt         |   4 -
 Documentation/git-status.txt       | 162 +++++++++++++++--------------
 Documentation/rev-list-options.txt |   4 -
 4 files changed, 86 insertions(+), 86 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 1/3] git-column.txt: fix section header
  2018-12-16 14:28     ` [PATCH v2 0/3] A few Asciidoctor-fixes Martin Ågren
@ 2018-12-16 14:28       ` Martin Ågren
  2018-12-16 14:28       ` [PATCH v2 2/3] Documentation: do not nest open blocks Martin Ågren
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 18+ messages in thread
From: Martin Ågren @ 2018-12-16 14:28 UTC (permalink / raw)
  To: git; +Cc: Jeff King

We have too few dashes under "Examples", which causes Asciidoctor to not
pick it up as a section header. Instead, it thinks we are starting a
code listing block, which ends up containing the remainder of the
document. The result is quite ugly.

Make sure we have as many dashes as we have characters in "Examples".
Asciidoc renders identically before and after this patch, both man-page
and html.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-column.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git-column.txt b/Documentation/git-column.txt
index 763afabb6d..f58e9c43e6 100644
--- a/Documentation/git-column.txt
+++ b/Documentation/git-column.txt
@@ -47,7 +47,7 @@ OPTIONS
 	The number of spaces between columns. One space by default.
 
 EXAMPLES
-------
+--------
 
 Format data by columns:
 ------------
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 2/3] Documentation: do not nest open blocks
  2018-12-16 14:28     ` [PATCH v2 0/3] A few Asciidoctor-fixes Martin Ågren
  2018-12-16 14:28       ` [PATCH v2 1/3] git-column.txt: fix section header Martin Ågren
@ 2018-12-16 14:28       ` Martin Ågren
  2018-12-16 14:28       ` [PATCH v2 3/3] git-status.txt: render tables correctly under Asciidoctor Martin Ågren
  2018-12-16 16:19       ` [PATCH v2 0/3] A few Asciidoctor-fixes Jeff King
  3 siblings, 0 replies; 18+ messages in thread
From: Martin Ågren @ 2018-12-16 14:28 UTC (permalink / raw)
  To: git; +Cc: Jeff King

It appears we try to nest open blocks, but that does not work well with
Asciidoctor, which fails to indent the inner blocks. As a result, they
do not visually seem to relate (as much) to the preceding paragraph as
they should. Drop the outer blocks to fix the rendering of the inner
ones. Asciidoc renders identically before and after this patch, both
man-pages and html.

This also makes Asciidoctor stop rendering a literal '+' before "Under
--pretty=oneline ..." in the manuals for git-log and git-rev-list.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-init.txt         | 4 ----
 Documentation/rev-list-options.txt | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index 3c5a67fb96..057076ca38 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -38,8 +38,6 @@ the repository to another place if --separate-git-dir is given).
 OPTIONS
 -------
 
---
-
 -q::
 --quiet::
 
@@ -111,8 +109,6 @@ into it.
 If you provide a 'directory', the command is run inside it. If this directory
 does not exist, it will be created.
 
---
-
 TEMPLATE DIRECTORY
 ------------------
 
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index bab5f50b17..98b538bc77 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -13,8 +13,6 @@ has a line that matches `<pattern>`), unless otherwise noted.
 Note that these are applied before commit
 ordering and formatting options, such as `--reverse`.
 
---
-
 -<number>::
 -n <number>::
 --max-count=<number>::
@@ -308,8 +306,6 @@ ifdef::git-rev-list[]
 	`<header>` text will be printed with each progress update.
 endif::git-rev-list[]
 
---
-
 History Simplification
 ~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 3/3] git-status.txt: render tables correctly under Asciidoctor
  2018-12-16 14:28     ` [PATCH v2 0/3] A few Asciidoctor-fixes Martin Ågren
  2018-12-16 14:28       ` [PATCH v2 1/3] git-column.txt: fix section header Martin Ågren
  2018-12-16 14:28       ` [PATCH v2 2/3] Documentation: do not nest open blocks Martin Ågren
@ 2018-12-16 14:28       ` Martin Ågren
  2018-12-16 16:19       ` [PATCH v2 0/3] A few Asciidoctor-fixes Jeff King
  3 siblings, 0 replies; 18+ messages in thread
From: Martin Ågren @ 2018-12-16 14:28 UTC (permalink / raw)
  To: git; +Cc: Jeff King

Asciidoctor removes the indentation of each line in these tables, so the
last lines of each table have a completely broken alignment.

Similar to 379805051d ("Documentation: render revisions correctly under
Asciidoctor", 2018-05-06), use an explicit literal block to indicate
that we want to keep the leading whitespace in the tables.

Because this gives us some extra indentation, we can remove the one that
we have been carrying explicitly. That is, drop the first four spaces of
indentation on each line. With Asciidoc (8.6.10), this results in
identical rendering before and after this commit, both for git-status.1
and git-status.html.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-status.txt | 162 ++++++++++++++++++-----------------
 1 file changed, 85 insertions(+), 77 deletions(-)

diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index d9f422d560..861d821d7f 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -197,31 +197,33 @@ codes can be interpreted as follows:
 Ignored files are not listed, unless `--ignored` option is in effect,
 in which case `XY` are `!!`.
 
-    X          Y     Meaning
-    -------------------------------------------------
-	     [AMD]   not updated
-    M        [ MD]   updated in index
-    A        [ MD]   added to index
-    D                deleted from index
-    R        [ MD]   renamed in index
-    C        [ MD]   copied in index
-    [MARC]           index and work tree matches
-    [ MARC]     M    work tree changed since index
-    [ MARC]     D    deleted in work tree
-    [ D]        R    renamed in work tree
-    [ D]        C    copied in work tree
-    -------------------------------------------------
-    D           D    unmerged, both deleted
-    A           U    unmerged, added by us
-    U           D    unmerged, deleted by them
-    U           A    unmerged, added by them
-    D           U    unmerged, deleted by us
-    A           A    unmerged, both added
-    U           U    unmerged, both modified
-    -------------------------------------------------
-    ?           ?    untracked
-    !           !    ignored
-    -------------------------------------------------
+....
+X          Y     Meaning
+-------------------------------------------------
+	 [AMD]   not updated
+M        [ MD]   updated in index
+A        [ MD]   added to index
+D                deleted from index
+R        [ MD]   renamed in index
+C        [ MD]   copied in index
+[MARC]           index and work tree matches
+[ MARC]     M    work tree changed since index
+[ MARC]     D    deleted in work tree
+[ D]        R    renamed in work tree
+[ D]        C    copied in work tree
+-------------------------------------------------
+D           D    unmerged, both deleted
+A           U    unmerged, added by us
+U           D    unmerged, deleted by them
+U           A    unmerged, added by them
+D           U    unmerged, deleted by us
+A           A    unmerged, both added
+U           U    unmerged, both modified
+-------------------------------------------------
+?           ?    untracked
+!           !    ignored
+-------------------------------------------------
+....
 
 Submodules have more state and instead report
 		M    the submodule has a different HEAD than
@@ -281,14 +283,16 @@ don't recognize.
 If `--branch` is given, a series of header lines are printed with
 information about the current branch.
 
-    Line                                     Notes
-    ------------------------------------------------------------
-    # branch.oid <commit> | (initial)        Current commit.
-    # branch.head <branch> | (detached)      Current branch.
-    # branch.upstream <upstream_branch>      If upstream is set.
-    # branch.ab +<ahead> -<behind>           If upstream is set and
-					     the commit is present.
-    ------------------------------------------------------------
+....
+Line                                     Notes
+------------------------------------------------------------
+# branch.oid <commit> | (initial)        Current commit.
+# branch.head <branch> | (detached)      Current branch.
+# branch.upstream <upstream_branch>      If upstream is set.
+# branch.ab +<ahead> -<behind>           If upstream is set and
+					 the commit is present.
+------------------------------------------------------------
+....
 
 ### Changed Tracked Entries
 
@@ -306,56 +310,60 @@ Renamed or copied entries have the following format:
 
     2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
 
-    Field       Meaning
-    --------------------------------------------------------
-    <XY>        A 2 character field containing the staged and
-		unstaged XY values described in the short format,
-		with unchanged indicated by a "." rather than
-		a space.
-    <sub>       A 4 character field describing the submodule state.
-		"N..." when the entry is not a submodule.
-		"S<c><m><u>" when the entry is a submodule.
-		<c> is "C" if the commit changed; otherwise ".".
-		<m> is "M" if it has tracked changes; otherwise ".".
-		<u> is "U" if there are untracked changes; otherwise ".".
-    <mH>        The octal file mode in HEAD.
-    <mI>        The octal file mode in the index.
-    <mW>        The octal file mode in the worktree.
-    <hH>        The object name in HEAD.
-    <hI>        The object name in the index.
-    <X><score>  The rename or copy score (denoting the percentage
-		of similarity between the source and target of the
-		move or copy). For example "R100" or "C75".
-    <path>      The pathname.  In a renamed/copied entry, this
-		is the target path.
-    <sep>       When the `-z` option is used, the 2 pathnames are separated
-		with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)
-		byte separates them.
-    <origPath>  The pathname in the commit at HEAD or in the index.
-		This is only present in a renamed/copied entry, and
-		tells where the renamed/copied contents came from.
-    --------------------------------------------------------
+....
+Field       Meaning
+--------------------------------------------------------
+<XY>        A 2 character field containing the staged and
+	    unstaged XY values described in the short format,
+	    with unchanged indicated by a "." rather than
+	    a space.
+<sub>       A 4 character field describing the submodule state.
+	    "N..." when the entry is not a submodule.
+	    "S<c><m><u>" when the entry is a submodule.
+	    <c> is "C" if the commit changed; otherwise ".".
+	    <m> is "M" if it has tracked changes; otherwise ".".
+	    <u> is "U" if there are untracked changes; otherwise ".".
+<mH>        The octal file mode in HEAD.
+<mI>        The octal file mode in the index.
+<mW>        The octal file mode in the worktree.
+<hH>        The object name in HEAD.
+<hI>        The object name in the index.
+<X><score>  The rename or copy score (denoting the percentage
+	    of similarity between the source and target of the
+	    move or copy). For example "R100" or "C75".
+<path>      The pathname.  In a renamed/copied entry, this
+	    is the target path.
+<sep>       When the `-z` option is used, the 2 pathnames are separated
+	    with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)
+	    byte separates them.
+<origPath>  The pathname in the commit at HEAD or in the index.
+	    This is only present in a renamed/copied entry, and
+	    tells where the renamed/copied contents came from.
+--------------------------------------------------------
+....
 
 Unmerged entries have the following format; the first character is
 a "u" to distinguish from ordinary changed entries.
 
     u <xy> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>
 
-    Field       Meaning
-    --------------------------------------------------------
-    <XY>        A 2 character field describing the conflict type
-		as described in the short format.
-    <sub>       A 4 character field describing the submodule state
-		as described above.
-    <m1>        The octal file mode in stage 1.
-    <m2>        The octal file mode in stage 2.
-    <m3>        The octal file mode in stage 3.
-    <mW>        The octal file mode in the worktree.
-    <h1>        The object name in stage 1.
-    <h2>        The object name in stage 2.
-    <h3>        The object name in stage 3.
-    <path>      The pathname.
-    --------------------------------------------------------
+....
+Field       Meaning
+--------------------------------------------------------
+<XY>        A 2 character field describing the conflict type
+	    as described in the short format.
+<sub>       A 4 character field describing the submodule state
+	    as described above.
+<m1>        The octal file mode in stage 1.
+<m2>        The octal file mode in stage 2.
+<m3>        The octal file mode in stage 3.
+<mW>        The octal file mode in the worktree.
+<h1>        The object name in stage 1.
+<h2>        The object name in stage 2.
+<h3>        The object name in stage 3.
+<path>      The pathname.
+--------------------------------------------------------
+....
 
 ### Other Items
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/4] A few Asciidoctor-fixes
  2018-12-16 10:44 ` [PATCH 0/4] " Jeff King
@ 2018-12-16 14:34   ` Martin Ågren
  2018-12-16 16:17     ` Jeff King
  0 siblings, 1 reply; 18+ messages in thread
From: Martin Ågren @ 2018-12-16 14:34 UTC (permalink / raw)
  To: Jeff King; +Cc: Git Mailing List

On Sun, 16 Dec 2018 at 11:45, Jeff King <peff@peff.net> wrote:
>
> On Sat, Dec 15, 2018 at 12:27:38PM +0100, Martin Ågren wrote:
> I think the relevant bits from [1] are:
>
>  * Use `make --always-make ... install-man` in doc-diff.
>  * ./doc-diff -f HEAD HEAD # note -f
>  * Add empty commit and tweak config.mak
>  * ./doc-diff HEAD^ HEAD # note no -f

Yes, that's it.

> To make this easier, it would make sense to me to:
>
>   - teach doc-diff a flag for marking one or both of the endpoints to be
>     built with asciidoctor versus asciidoc
>
>   - mark the asciidoc/asciidoctor in the directory name. That name
>     serves as a cache key for avoiding re-doing the work, you should be
>     able to just:
>
>       ./doc-diff --asciidoctor HEAD HEAD
>
>     and actually build and compare what you want.
>
>   - it sounds from "make --always-make" that our Makefile does not
>     properly rebuild when we switch from asciidoc to asciidoctor. That

Exactly.

>     might be nice to fix with a mechanism similar to the GIT-BUILD-FLAGS
>     we use in the top-level Makefile.

Agreed on all three points. The last one would supposedly be useful on
its own, beyond this doc-diff motivation.

Your list seems complete to me in terms of "how could we teach doc-diff
to diff asciidoctor vs asciidoc?". For the resulting diff to actually be
useful ;-) there are two more outstanding issues that I see:

  - Headers and footers. Asciidoc (driven by doc-diff) uses some
    boilerplate values which avoid timestamps and the like. Asciidoctor
    partly uses different values, partly interprets the ones given
    differently.

  - Asciidoctor introduces a space after linkgit:foo , e.g., before
    punctuation.

Both of these are problems in their own right, so they probably
shouldn't be suppressed in the resulting diff. But as long as these
issues remain, they produce a lot of noise which might hide more
interesting (IMHO) differences.

Martin

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/4] A few Asciidoctor-fixes
  2018-12-16 14:34   ` Martin Ågren
@ 2018-12-16 16:17     ` Jeff King
  0 siblings, 0 replies; 18+ messages in thread
From: Jeff King @ 2018-12-16 16:17 UTC (permalink / raw)
  To: Martin Ågren; +Cc: Git Mailing List

On Sun, Dec 16, 2018 at 03:34:42PM +0100, Martin Ågren wrote:

> Your list seems complete to me in terms of "how could we teach doc-diff
> to diff asciidoctor vs asciidoc?". For the resulting diff to actually be
> useful ;-) there are two more outstanding issues that I see:
> 
>   - Headers and footers. Asciidoc (driven by doc-diff) uses some
>     boilerplate values which avoid timestamps and the like. Asciidoctor
>     partly uses different values, partly interprets the ones given
>     differently.
> 
>   - Asciidoctor introduces a space after linkgit:foo , e.g., before
>     punctuation.
> 
> Both of these are problems in their own right, so they probably
> shouldn't be suppressed in the resulting diff. But as long as these
> issues remain, they produce a lot of noise which might hide more
> interesting (IMHO) differences.

If there are a small number of distinct problems (that each have many
instances), I'm not opposed to having a mode to suppress them in the
resulting diff, so we can see the other problems more clearly.  Of
course, just fixing them is even better. ;)

The first one sounds like it may be a candidate for suppressing (i.e.,
it's not necessarily an actual problem).

-Peff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 0/3] A few Asciidoctor-fixes
  2018-12-16 14:28     ` [PATCH v2 0/3] A few Asciidoctor-fixes Martin Ågren
                         ` (2 preceding siblings ...)
  2018-12-16 14:28       ` [PATCH v2 3/3] git-status.txt: render tables correctly under Asciidoctor Martin Ågren
@ 2018-12-16 16:19       ` Jeff King
  3 siblings, 0 replies; 18+ messages in thread
From: Jeff King @ 2018-12-16 16:19 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git

On Sun, Dec 16, 2018 at 03:28:56PM +0100, Martin Ågren wrote:

> This series addresses a few instances where our documentation renders
> badly in Asciidoctor, compared to Asciidoc. The changes made are exactly
> the same as in v1 [1], but the first commit message is corrected, and
> the two patches 2/4 and 3/4 are now just a single patch 2/3.
> 
> Thanks Peff for your comments on v1.

Thanks, this all looks quite sensible to me (I didn't hack up doc-diff
as you did, but I did eyeball the before/after html from asciidoctor).

-Peff

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-12-16 16:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-15 11:27 [PATCH 0/4] A few Asciidoctor-fixes Martin Ågren
2018-12-15 11:27 ` [PATCH 1/4] git-column.txt: fix section header Martin Ågren
2018-12-16 10:51   ` Jeff King
2018-12-16 14:27     ` Martin Ågren
2018-12-15 11:27 ` [PATCH 2/4] git-init.txt: do not nest open blocks Martin Ågren
2018-12-16 10:55   ` Jeff King
2018-12-15 11:27 ` [PATCH 3/4] rev-list-options.txt: " Martin Ågren
2018-12-16 10:56   ` Jeff King
2018-12-15 11:27 ` [PATCH 4/4] git-status.txt: render tables correctly under Asciidoctor Martin Ågren
2018-12-16 10:59   ` Jeff King
2018-12-16 14:28     ` [PATCH v2 0/3] A few Asciidoctor-fixes Martin Ågren
2018-12-16 14:28       ` [PATCH v2 1/3] git-column.txt: fix section header Martin Ågren
2018-12-16 14:28       ` [PATCH v2 2/3] Documentation: do not nest open blocks Martin Ågren
2018-12-16 14:28       ` [PATCH v2 3/3] git-status.txt: render tables correctly under Asciidoctor Martin Ågren
2018-12-16 16:19       ` [PATCH v2 0/3] A few Asciidoctor-fixes Jeff King
2018-12-16 10:44 ` [PATCH 0/4] " Jeff King
2018-12-16 14:34   ` Martin Ågren
2018-12-16 16:17     ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).