mbox series

[RFC,v1,00/13,GSoC] doc: (monospace) apply CodingGuidelines on a large-scale

Message ID 20210409040301.3260358-1-firminmartin24@gmail.com (mailing list archive)
Headers show
Series doc: (monospace) apply CodingGuidelines on a large-scale | expand

Message

Firmin Martin April 9, 2021, 4:02 a.m. UTC
This patch series aims to make the documentation fully compliant to the
CodingGuidelines regarding monospace font. After it, new contributors
who just want to change a little portion of the documention could just
look around how it has been done without being confused by the
inconsistency between the documentation and the CodingGuidelines.

Concretely: unquoted, single-quoted or double-quoted entities detailed
below in the summary are wrapped or converted in backticks.

Except some easy cases, the methodology consists of using simple regex
to find relevant files, then interactively substitute targeted entities
with progressively smarter regex to exclude false positives. As the
review process could be very tedious, I have been very cautious and have
reviewed myself a couple of times every changes. Consequently, mistakes,
if there are any, are not due to the regex, but my personal
misinterpretation of the context.

Below is some changes I plan to make in v2 which request
comments/approvals of the community.

* Placeholders and option values should be in italic. (Cf. man man) 
    - e.g. `--date`='<format>', `--notes`[='<ref>'], `branch.`'<name>'`.remote`
    - e.g. `--date`='rfc2822'
    - Compare gcc and git-add
        - man gcc vs. man git-add 
        - https://linux.die.net/man/1/gcc vs. https://linux.die.net/man/1/git-add
* The Synopsis section should be formatted based on the current
CodingGuidelines plus the above suggestion. IOW, for instance, options should
be wrapped in backticks. Again, to have an idea, compare gcc and git-add. 

Best,

Firmin

Firmin Martin (13):
  doc: typeset command-line options in monospace
  doc: typeset branches and remotes in monospace
  doc: typeset configuration options in monospace
  doc: typeset git-related commands in monospace
  doc: typeset git-svn subcommands in monospace
  doc: typeset dummy URLs and protocols in monospace
  doc: typeset git dotfiles in monospace
  doc: typeset filepath and $variables in monospace
  doc: typeset command/option/value entries in monospace
  doc: typeset more command entries in monospace
  doc: typeset config option entries in monospace
  doc: typeset environment vars without $ in monospace
  doc: typeset common programs in monospace

 Documentation/CodingGuidelines                |   2 +-
 Documentation/MyFirstContribution.txt         |   8 +-
 Documentation/SubmittingPatches               |   2 +-
 Documentation/blame-options.txt               |  50 +-
 Documentation/config.txt                      |  38 +-
 Documentation/config/diff.txt                 |   2 +-
 Documentation/config/gitcvs.txt               |   6 +-
 Documentation/diff-format.txt                 |  12 +-
 Documentation/diff-generate-patch.txt         |   8 +-
 Documentation/diff-options.txt                | 252 +++----
 Documentation/fetch-options.txt               | 136 ++--
 Documentation/git-add.txt                     |  86 +--
 Documentation/git-am.txt                      | 116 +--
 Documentation/git-apply.txt                   |  84 +--
 Documentation/git-archimport.txt              |  34 +-
 Documentation/git-archive.txt                 |  52 +-
 Documentation/git-bisect-lk2009.txt           | 188 ++---
 Documentation/git-bisect.txt                  |  48 +-
 Documentation/git-blame.txt                   |  32 +-
 Documentation/git-branch.txt                  | 156 ++--
 Documentation/git-bugreport.txt               |  14 +-
 Documentation/git-bundle.txt                  |  74 +-
 Documentation/git-cat-file.txt                |  42 +-
 Documentation/git-check-attr.txt              |  18 +-
 Documentation/git-check-ignore.txt            |  16 +-
 Documentation/git-check-mailmap.txt           |   4 +-
 Documentation/git-check-ref-format.txt        |  16 +-
 Documentation/git-checkout-index.txt          |  42 +-
 Documentation/git-checkout.txt                | 114 +--
 Documentation/git-cherry-pick.txt             |  76 +-
 Documentation/git-cherry.txt                  |  20 +-
 Documentation/git-citool.txt                  |   6 +-
 Documentation/git-clean.txt                   |  66 +-
 Documentation/git-clone.txt                   | 104 +--
 Documentation/git-column.txt                  |  26 +-
 Documentation/git-commit-graph.txt            |  12 +-
 Documentation/git-commit-tree.txt             |  22 +-
 Documentation/git-commit.txt                  | 174 ++---
 Documentation/git-config.txt                  | 174 ++---
 Documentation/git-count-objects.txt           |  16 +-
 .../git-credential-cache--daemon.txt          |   2 +-
 Documentation/git-credential-cache.txt        |   8 +-
 Documentation/git-credential-store.txt        |  12 +-
 Documentation/git-credential.txt              |  16 +-
 Documentation/git-cvsexportcommit.txt         |  46 +-
 Documentation/git-cvsimport.txt               |  84 +--
 Documentation/git-cvsserver.txt               | 110 +--
 Documentation/git-daemon.txt                  | 150 ++--
 Documentation/git-describe.txt                |  80 +-
 Documentation/git-diff-files.txt              |  18 +-
 Documentation/git-diff-index.txt              |  34 +-
 Documentation/git-diff-tree.txt               |  46 +-
 Documentation/git-diff.txt                    |  64 +-
 Documentation/git-difftool.txt                |  78 +-
 Documentation/git-fast-export.txt             |  84 +--
 Documentation/git-fast-import.txt             | 140 ++--
 Documentation/git-fetch-pack.txt              |  72 +-
 Documentation/git-fetch.txt                   |  46 +-
 Documentation/git-filter-branch.txt           | 164 ++---
 Documentation/git-fmt-merge-msg.txt           |  30 +-
 Documentation/git-for-each-ref.txt            |  80 +-
 Documentation/git-for-each-repo.txt           |   4 +-
 Documentation/git-format-patch.txt            | 132 ++--
 Documentation/git-fsck-objects.txt            |   2 +-
 Documentation/git-fsck.txt                    |  74 +-
 Documentation/git-gc.txt                      |  36 +-
 Documentation/git-get-tar-commit-id.txt       |   8 +-
 Documentation/git-grep.txt                    | 178 ++---
 Documentation/git-gui.txt                     |  32 +-
 Documentation/git-hash-object.txt             |  20 +-
 Documentation/git-help.txt                    |  78 +-
 Documentation/git-http-backend.txt            |  72 +-
 Documentation/git-http-fetch.txt              |  24 +-
 Documentation/git-http-push.txt               |  22 +-
 Documentation/git-imap-send.txt               |  20 +-
 Documentation/git-index-pack.txt              |  48 +-
 Documentation/git-init-db.txt                 |   2 +-
 Documentation/git-init.txt                    |  28 +-
 Documentation/git-instaweb.txt                |  44 +-
 Documentation/git-interpret-trailers.txt      |  80 +-
 Documentation/git-log.txt                     |  56 +-
 Documentation/git-ls-files.txt                | 126 ++--
 Documentation/git-ls-remote.txt               |  46 +-
 Documentation/git-ls-tree.txt                 |  38 +-
 Documentation/git-mailinfo.txt                |  36 +-
 Documentation/git-mailsplit.txt               |  20 +-
 Documentation/git-maintenance.txt             |  32 +-
 Documentation/git-merge-base.txt              |  32 +-
 Documentation/git-merge-file.txt              |  26 +-
 Documentation/git-merge-index.txt             |  16 +-
 Documentation/git-merge-one-file.txt          |   6 +-
 Documentation/git-merge-tree.txt              |   4 +-
 Documentation/git-merge.txt                   |  78 +-
 Documentation/git-mergetool--lib.txt          |   8 +-
 Documentation/git-mergetool.txt               |  40 +-
 Documentation/git-mktag.txt                   |   4 +-
 Documentation/git-mktree.txt                  |   8 +-
 Documentation/git-multi-pack-index.txt        |  18 +-
 Documentation/git-mv.txt                      |  28 +-
 Documentation/git-name-rev.txt                |  32 +-
 Documentation/git-notes.txt                   | 170 ++---
 Documentation/git-p4.txt                      | 318 ++++----
 Documentation/git-pack-objects.txt            | 122 ++--
 Documentation/git-pack-redundant.txt          |  10 +-
 Documentation/git-pack-refs.txt               |  12 +-
 Documentation/git-patch-id.txt                |  22 +-
 Documentation/git-prune-packed.txt            |  10 +-
 Documentation/git-prune.txt                   |  30 +-
 Documentation/git-pull.txt                    |  42 +-
 Documentation/git-push.txt                    | 136 ++--
 Documentation/git-quiltimport.txt             |  18 +-
 Documentation/git-range-diff.txt              |  16 +-
 Documentation/git-read-tree.txt               | 118 +--
 Documentation/git-rebase.txt                  | 384 +++++-----
 Documentation/git-receive-pack.txt            |  48 +-
 Documentation/git-reflog.txt                  |  36 +-
 Documentation/git-remote-ext.txt              |  40 +-
 Documentation/git-remote-fd.txt               |  16 +-
 Documentation/git-remote.txt                  |  62 +-
 Documentation/git-repack.txt                  |  64 +-
 Documentation/git-replace.txt                 |  42 +-
 Documentation/git-request-pull.txt            |  12 +-
 Documentation/git-rerere.txt                  |  80 +-
 Documentation/git-reset.txt                   |  60 +-
 Documentation/git-restore.txt                 |  58 +-
 Documentation/git-rev-list.txt                |   6 +-
 Documentation/git-rev-parse.txt               | 148 ++--
 Documentation/git-revert.txt                  |  54 +-
 Documentation/git-rm.txt                      |  32 +-
 Documentation/git-send-email.txt              | 192 ++---
 Documentation/git-send-pack.txt               |  44 +-
 Documentation/git-sh-i18n--envsubst.txt       |   2 +-
 Documentation/git-sh-i18n.txt                 |   4 +-
 Documentation/git-sh-setup.txt                |  10 +-
 Documentation/git-shell.txt                   |  26 +-
 Documentation/git-shortlog.txt                |  32 +-
 Documentation/git-show-branch.txt             |  66 +-
 Documentation/git-show-index.txt              |   4 +-
 Documentation/git-show-ref.txt                |  58 +-
 Documentation/git-show.txt                    |  12 +-
 Documentation/git-sparse-checkout.txt         |  18 +-
 Documentation/git-stage.txt                   |   2 +-
 Documentation/git-stash.txt                   |  80 +-
 Documentation/git-status.txt                  |  78 +-
 Documentation/git-stripspace.txt              |  16 +-
 Documentation/git-submodule.txt               | 172 ++---
 Documentation/git-svn.txt                     | 690 +++++++++---------
 Documentation/git-switch.txt                  |  76 +-
 Documentation/git-symbolic-ref.txt            |  22 +-
 Documentation/git-tag.txt                     | 108 +--
 Documentation/git-unpack-file.txt             |   4 +-
 Documentation/git-unpack-objects.txt          |  12 +-
 Documentation/git-update-index.txt            | 132 ++--
 Documentation/git-update-ref.txt              |  40 +-
 Documentation/git-update-server-info.txt      |   6 +-
 Documentation/git-upload-archive.txt          |  10 +-
 Documentation/git-upload-pack.txt             |  20 +-
 Documentation/git-var.txt                     |  20 +-
 Documentation/git-verify-commit.txt           |  10 +-
 Documentation/git-verify-pack.txt             |  14 +-
 Documentation/git-verify-tag.txt              |  10 +-
 Documentation/git-web--browse.txt             |  26 +-
 Documentation/git-whatchanged.txt             |   8 +-
 Documentation/git-worktree.txt                |  74 +-
 Documentation/git-write-tree.txt              |  12 +-
 Documentation/git.txt                         | 142 ++--
 Documentation/gitattributes.txt               |  88 +--
 Documentation/gitcli.txt                      |   6 +-
 Documentation/gitcore-tutorial.txt            | 212 +++---
 Documentation/gitcredentials.txt              |  20 +-
 Documentation/gitcvs-migration.txt            |  14 +-
 Documentation/gitdiffcore.txt                 |  60 +-
 Documentation/giteveryday.txt                 |  24 +-
 Documentation/gitfaq.txt                      |   6 +-
 Documentation/githooks.txt                    |  26 +-
 Documentation/gitignore.txt                   |  16 +-
 Documentation/gitk.txt                        |  64 +-
 Documentation/gitmailmap.txt                  |   2 +-
 Documentation/gitmodules.txt                  |  26 +-
 Documentation/gitnamespaces.txt               |  12 +-
 Documentation/gitremote-helpers.txt           |  90 +--
 Documentation/gitrepository-layout.txt        | 114 +--
 Documentation/gitsubmodules.txt               |   2 +-
 Documentation/gittutorial-2.txt               |  38 +-
 Documentation/gittutorial.txt                 | 100 +--
 Documentation/gitweb.conf.txt                 | 320 ++++----
 Documentation/gitweb.txt                      | 168 ++---
 Documentation/gitworkflows.txt                |  76 +-
 Documentation/glossary-content.txt            |  38 +-
 Documentation/howto/revert-branch-rebase.txt  |   2 +-
 .../howto/setup-git-server-over-http.txt      |   2 +-
 Documentation/i18n.txt                        |   4 +-
 Documentation/merge-options.txt               | 100 +--
 Documentation/merge-strategies.txt            |  36 +-
 Documentation/pretty-formats.txt              |  16 +-
 Documentation/pretty-options.txt              |  52 +-
 Documentation/pull-fetch-param.txt            |  18 +-
 Documentation/rev-list-options.txt            | 242 +++---
 Documentation/revisions.txt                   |  76 +-
 Documentation/sequencer.txt                   |   8 +-
 Documentation/signoff-option.txt              |   8 +-
 Documentation/urls-remotes.txt                |  12 +-
 Documentation/urls.txt                        |  40 +-
 Documentation/user-manual.txt                 | 116 +--
 204 files changed, 5971 insertions(+), 5971 deletions(-)

Comments

Jean-Noël Avila April 12, 2021, 1:37 p.m. UTC | #1
Le 09/04/2021 à 06:02, Firmin Martin a écrit :
> This patch series aims to make the documentation fully compliant to the
> CodingGuidelines regarding monospace font. After it, new contributors
> who just want to change a little portion of the documention could just
> look around how it has been done without being confused by the
> inconsistency between the documentation and the CodingGuidelines.


Thank you for tackling the task of formating the docu and directing to
CodingGuidelines for some markup rules. It appears that the last rule
about backticks is wrong with late Asciidoctor, for which backticks are
only a font switcher and no longer hold any semantic meaning. This means
that double-hyphens may need escaping (see:
https://asciidoctor.org/docs/migration/#migration-cheatsheet) when
switching style and tools.

One other rule worth adding would be that tabs are banned from asciidoc
because they cannot always be matched with correct indentation.
Firmin Martin April 13, 2021, 8:42 p.m. UTC | #2
Hi Jean-Noël,

Jean-Noël Avila <avila.jn@gmail.com> writes:

> Le 09/04/2021 à 06:02, Firmin Martin a écrit :
>> This patch series aims to make the documentation fully compliant to the
>> CodingGuidelines regarding monospace font. After it, new contributors
>> who just want to change a little portion of the documention could just
>> look around how it has been done without being confused by the
>> inconsistency between the documentation and the CodingGuidelines.
>
>
> Thank you for tackling the task of formating the docu and directing to
> CodingGuidelines for some markup rules. It appears that the last rule
> about backticks is wrong with late Asciidoctor, for which backticks are
Thanks. As a new Git contributor, I used to think that we don't use asciidoctor,
until I see in Documentation/Makefile:

    ifdef USE_ASCIIDOCTOR
    ASCIIDOC = asciidoctor
    ...
    ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
    ...
    endif

So, we actually use both depending the variable USE_ASCIIDOCTOR. 

> only a font switcher and no longer hold any semantic meaning. This means
> that double-hyphens may need escaping (see:
> https://asciidoctor.org/docs/migration/#migration-cheatsheet) when
> switching style and tools.

In the helpful link that you provide, it says that the "setext-style
(i.e., two-line) section title" enables compatibility mode.  As far as I
can tell, most man pages (git.*.txt) fall under this category, except
the most important one: user-manual.txt.  But this is in fact not
relevant, because the snippet above of the Makefile suggests that we
actually explicitly running asciidoctor in compatibility mode.

> One other rule worth adding would be that tabs are banned from asciidoc
> because they cannot always be matched with correct indentation.

I'm an absolute novice regarding AsciiDoc vs. Asciidoctor. But from the
user guide of AsciiDoc (https://asciidoc.org/userguide.html#_tabs), it says

    By default tab characters input files will translated to 8
    spaces. Tab expansion is set with the tabsize entry in the
    configuration file [miscellaneous] section and can be overridden in
    included files by setting a tabsize attribute in the include macro’s
    attribute list. For example:

    include::addendum.txt[tabsize=2] The tab size can also be set using
    the attribute command-line option, for example --attribute tabsize=4

... and we also explicitly set it to 8 spaces (see above). Could you
elaborate a bit on the matter ?

Thanks,

Firmin
Jean-Noël Avila April 19, 2021, 9:04 a.m. UTC | #3
Le 13/04/2021 à 22:42, Firmin Martin a écrit :
> Hi Jean-Noël,
>
> Jean-Noël Avila <avila.jn@gmail.com> writes:
>
>> Le 09/04/2021 à 06:02, Firmin Martin a écrit :
>>> This patch series aims to make the documentation fully compliant to the
>>> CodingGuidelines regarding monospace font. After it, new contributors
>>> who just want to change a little portion of the documention could just
>>> look around how it has been done without being confused by the
>>> inconsistency between the documentation and the CodingGuidelines.
>>
>> Thank you for tackling the task of formating the docu and directing to
>> CodingGuidelines for some markup rules. It appears that the last rule
>> about backticks is wrong with late Asciidoctor, for which backticks are
> Thanks. As a new Git contributor, I used to think that we don't use asciidoctor,
> until I see in Documentation/Makefile:
>
>     ifdef USE_ASCIIDOCTOR
>     ASCIIDOC = asciidoctor
>     ...
>     ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
>     ...
>     endif
>
> So, we actually use both depending the variable USE_ASCIIDOCTOR. 
>
>> only a font switcher and no longer hold any semantic meaning. This means
>> that double-hyphens may need escaping (see:
>> https://asciidoctor.org/docs/migration/#migration-cheatsheet) when
>> switching style and tools.
> In the helpful link that you provide, it says that the "setext-style
> (i.e., two-line) section title" enables compatibility mode.  As far as I
> can tell, most man pages (git.*.txt) fall under this category, except
> the most important one: user-manual.txt.  But this is in fact not
> relevant, because the snippet above of the Makefile suggests that we
> actually explicitly running asciidoctor in compatibility mode.


If we are to continue using asciidoctor, I guess this compatibility mode
will be removed at some point in the future. I don't have all the
required inputs for how asciidoc and asciidoctor will evolve and may
split in their behavior, but here is how I see it:

There's now a working group whose interest is in standardizing asciidoc
and making the format evolve
(https://www.eclipse.org/org/workinggroups/asciidoc-charter.php). It is
led by the authors of asciidoctor, so I guess most of the path forward
for asciidoc format is asciidoctor and leaving compatibility mode behind
as a legacy format.


>
>> One other rule worth adding would be that tabs are banned from asciidoc
>> because they cannot always be matched with correct indentation.
> I'm an absolute novice regarding AsciiDoc vs. Asciidoctor. But from the
> user guide of AsciiDoc (https://asciidoc.org/userguide.html#_tabs), it says
>
>     By default tab characters input files will translated to 8
>     spaces. Tab expansion is set with the tabsize entry in the
>     configuration file [miscellaneous] section and can be overridden in
>     included files by setting a tabsize attribute in the include macro’s
>     attribute list. For example:
>
>     include::addendum.txt[tabsize=2] The tab size can also be set using
>     the attribute command-line option, for example --attribute tabsize=4
>
> ... and we also explicitly set it to 8 spaces (see above). Could you
> elaborate a bit on the matter ?

Tab management in asciidoc and asciidoctor was the source of a number of
bugs, because the markup relies on "visual" alignment instead of
semantic alignment. So you have to define tabsize in order for tabs to
be correctly interpreted. Instead of having to add specification, my
approach would be to just get rid of the source and the solution of the
issue at the same time.
Jean-Noël Avila April 19, 2021, 9:33 a.m. UTC | #4
Le 13/04/2021 à 22:42, Firmin Martin a écrit :

> I'm an absolute novice regarding AsciiDoc vs. Asciidoctor. 


Here are some news:


https://groups.google.com/g/asciidoc/c/kaqYgpmWrJk