All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jean-Noël Avila" <jn.avila@free.fr>
To: "Martin Ågren" <martin.agren@gmail.com>,
	"Jean-Noël Avila via GitGitGadget" <gitgitgadget@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] doc: fix grammar rules in commands'syntax
Date: Thu, 28 Oct 2021 11:31:57 +0200	[thread overview]
Message-ID: <819ab0ed-8a99-2987-79c9-88cd1118b51b@free.fr> (raw)
In-Reply-To: <CAN0heSpRZy3+jyc09NEj4NJk4zN4X_RyVk33F5c6tyUE2qMGzQ@mail.gmail.com>

Le 27/10/2021 à 20:56, Martin Ågren a écrit :
> On Tue, 26 Oct 2021 at 21:35, Jean-Noël Avila via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>>
>> --- a/Documentation/git-archimport.txt
>> +++ b/Documentation/git-archimport.txt
>> @@ -9,8 +9,8 @@ git-archimport - Import a GNU Arch repository into Git
>>  SYNOPSIS
>>  --------
>>  [verse]
>> -'git archimport' [-h] [-v] [-o] [-a] [-f] [-T] [-D depth] [-t tempdir]
>> -               <archive/branch>[:<git-branch>] ...
>> +'git archimport' [-h] [-v] [-o] [-a] [-f] [-T] [-D <depth>] [-t <tempdir>]
>> +              <archive>/<branch>[:<git-branch>]...
> 
> Your rewrite makes it seem like one would write, e.g., "myarch/master"
> with a literal slash, whereas my initial thought was that the original
> tried to express something like "(<archive> | <branch>)". But I have
> zero experience with "GNU Arch" and git-archimport, so I can't really
> tell whether your rewrite is for the better or not. :-)

The <archive>/<branch> grammar is the one available in the usage of the
command.


> 
> In any case, this document goes on to write "<archive/branch>" several
> times. Supposedly, they would all want to be changed as well. There's
> also an instance of "Archive/branch identifier ..." to maybe look into.

Ack. All the changes in a single commit

> 
>> --- a/Documentation/git-cvsimport.txt
>> +++ b/Documentation/git-cvsimport.txt
>> @@ -9,11 +9,11 @@ git-cvsimport - Salvage your data out of another SCM people love to hate
>>  SYNOPSIS
>>  --------
>>  [verse]
>> -'git cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]
>> +'git cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <cvsroot>]
> 
>> -<CVS_module>::
>> +<CVS-module>::
>>         The CVS module you want to import. Relative to <CVSROOT>.
> 
> Here's another "<CVSROOT>".

Is this an environment variable or a placeholder?

> 
>> --- a/Documentation/git-http-push.txt
>> +++ b/Documentation/git-http-push.txt
>> @@ -63,16 +63,15 @@ of such patterns separated by a colon ":" (this means that a ref name
> 
>> -Each pattern pair consists of the source side (before the colon)
>> -and the destination side (after the colon).  The ref to be
>> -pushed is determined by finding a match that matches the source
>> -side, and where it is pushed is determined by using the
>> -destination side.
>> +Each pattern pair '<src>:<dst>' consists of the source side (before
>> +the colon) and the destination side (after the colon).  The ref to be
>> +pushed is determined by finding a match that matches the source side,
>> +and where it is pushed is determined by using the destination side.
> 
> This looks like the insertion of "'<src>:<dst>' early on, where the rest
> of the changes are just follow-on line-wrapping.
> 

Strict line-wrapping doesn't work well with version control in free
text. And it doesn't work well either with asciidoc, where some unlucky
wrapping can generate spurious formatting.

> I wonder if this patch could benefit from being broken into smaller
> pieces. Maybe a few preliminaries like "change <foo|bar|baz> to
> (foo|bar|baz)" and the like, then even if the final patch is "large", it
> will not be *as large*? But there are clearly sub-topics here, such as
> "change <some_arg> to <some-arg>" and "change arg to <arg>". Or maybe
> this doesn't make sense as an approach to cutting this patch into
> smaller pieces, but I thought I'd mention it.

The changes are muliplying. I will split them.

> 
>> - - It is an error if <src> does not match exactly one of the
>> + - It is an error if '<src>' does not match exactly one of the
>>     local refs.
>>
>> - - If <dst> does not match any remote ref, either
>> + - If '<dst>' does not match any remote ref, either
> 
> I believe these match Junio's preference, so ok. But again, this looks
> like it could go in a separate patch from a lot of these other changes
> as a way of keeping to somewhat focused changes.
> 
>> -               (--[cached|deleted|others|ignored|stage|unmerged|killed|modified])*
>> -               (-[c|d|o|i|s|u|k|m])*
>> +               [--(cached|deleted|others|ignored|stage|unmerged|killed|modified)...]
>> +               [-(c|d|o|i|s|u|k|m)...]
> 
> Sort of cute how this saves on repeating the "--" by pulling it out.
> Anyway, nothing new in your patch. :-)

To me, the grammar should express at the token level (not like here),
and anyway, this synopsis is not correct: even if these options are
allowed to be repeated several times on the command line, this is
useless and some of them have the same meaning (and this should be
shown). This way of expressing the grammar induce the reader into
thinking that this is some kind of inner grammar to the command.


Jean-Noël

  parent reply	other threads:[~2021-10-28  9:32 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 15:11 [PATCH] doc: fix grammar rules in commands'syntax Jean-Noël Avila via GitGitGadget
2021-10-26 18:21 ` Eric Sunshine
2021-10-27 13:01   ` Jean-Noël Avila
2021-10-27 18:56 ` Martin Ågren
2021-10-27 20:08   ` Eric Sunshine
2021-10-28  9:31   ` Jean-Noël Avila [this message]
2021-10-28 18:47     ` Martin Ågren
2021-10-28 16:21 ` [PATCH v2 0/9] doc: fix grammar rules in commands' syntax Jean-Noël Avila via GitGitGadget
2021-10-28 16:21   ` [PATCH v2 1/9] doc: fix git credential synopsis Jean-Noël Avila via GitGitGadget
2021-10-28 16:21   ` [PATCH v2 2/9] doc: split placeholders as individual tokens Jean-Noël Avila via GitGitGadget
2021-10-28 18:45     ` Martin Ågren
2021-10-28 16:21   ` [PATCH v2 3/9] doc: express grammar placeholders between angle brackets Jean-Noël Avila via GitGitGadget
2021-10-28 17:46     ` Eric Sunshine
2021-10-28 19:36       ` Junio C Hamano
2021-10-28 16:21   ` [PATCH v2 4/9] doc: use only hyphens as word separators in placeholders Jean-Noël Avila via GitGitGadget
2021-10-28 18:47     ` Martin Ågren
2021-10-28 19:35       ` Junio C Hamano
2021-10-31 18:58     ` Eli Schwartz
2021-10-31 20:23       ` Jean-Noël AVILA
2021-11-01  6:47         ` Junio C Hamano
2021-11-03 12:46           ` Jean-Noël Avila
2021-11-03 16:28             ` Junio C Hamano
2021-11-04  0:38               ` Johannes Schindelin
2021-11-04 17:36                 ` Junio C Hamano
2021-11-07 12:40                 ` Eli Schwartz
2021-10-28 16:22   ` [PATCH v2 5/9] doc: git-ls-files: express options as optional alternatives Jean-Noël Avila via GitGitGadget
2021-10-28 16:22   ` [PATCH v2 6/9] doc: use three dots for indicating repetition instead of star Jean-Noël Avila via GitGitGadget
2021-10-28 16:22   ` [PATCH v2 7/9] doc: uniformize <URL> placeholders' case Jean-Noël Avila via GitGitGadget
2021-10-28 17:53     ` Junio C Hamano
2021-10-28 16:22   ` [PATCH v2 8/9] doc: git-http-push: describe the refs as pattern pairs Jean-Noël Avila via GitGitGadget
2021-10-28 17:55     ` Junio C Hamano
2021-10-28 16:22   ` [PATCH v2 9/9] doc: git-init: clarify file modes in octal Jean-Noël Avila via GitGitGadget
2021-10-28 17:17     ` Junio C Hamano
2021-10-28 17:25       ` Junio C Hamano
2021-10-28 19:22   ` [PATCH v2 0/9] doc: fix grammar rules in commands' syntax Junio C Hamano
2021-11-06 18:48 ` [PATCH v3 00/10] " Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 01/10] doc: fix git credential synopsis Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 02/10] doc: split placeholders as individual tokens Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 03/10] doc: express grammar placeholders between angle brackets Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 04/10] doc: use only hyphens as word separators in placeholders Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 05/10] doc: git-ls-files: express options as optional alternatives Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 06/10] doc: use three dots for indicating repetition instead of star Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 07/10] doc: uniformize <URL> placeholders' case Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 08/10] doc: git-http-push: describe the refs as pattern pairs Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 09/10] doc: git-init: clarify file modes in octal Jean-Noël Avila
2021-11-07 13:20     ` Johannes Altmanninger
2021-11-06 18:48   ` [PATCH v3 10/10] init doc: --shared=0xxx does not give umask but perm bits Jean-Noël Avila
2021-11-07 13:22     ` Johannes Altmanninger
2021-11-09 17:32       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=819ab0ed-8a99-2987-79c9-88cd1118b51b@free.fr \
    --to=jn.avila@free.fr \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=martin.agren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.