From: Jean-Noël Avila Date: Wed, 27 Oct 2021 13:01:04 GMT Subject: Re: [PATCH] doc: fix grammar rules in commands'syntax Message-ID: <76e58ef5-62c4-ae9e-2557-40345734de25@free.fr> In-Reply-To: On Tue, Oct 26, 2021, Eric Sunshine wrote: > On Tue, Oct 26, 2021 at 11:11 AM Jean-Noël Avila via GitGitGadget > wrote: >> doc: fix grammar rules in commands'syntax > > Missing space. > >> According to the coding guidelines, the placeholders must: >> * be in small letters >> * enclosed in angle brackets >> >> Some other rules are also applied. > > Perhaps just mention them here? > > * use hyphens rather than underscores or spaces > between words There are a lot more places with spaces within placeholders. Will extend. > * indicate repetition with `...` rather than `*` > > were some that I saw while reading. > > Overall, the patch looks good. One or two notes below... Thanks for taking time to review this cumbersome patch. > >> Signed-off-by: Jean-Noël Avila >> --- >> diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt >> @@ -11,7 +11,7 @@ SYNOPSIS >> -'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] ] [] >> +'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] ] [] > > Nice to see this attention to detail. > >> @@ -43,7 +43,7 @@ You could omit ``, in which case the command degenerates to >> -'git checkout' -b|-B []:: >> +'git checkout' -b|-B []:: > > Likewise. > >> @@ -145,11 +145,11 @@ as `ours` (i.e. "our shared canonical history"), while what you did >> --b :: >> +-b :: >> Create a new branch named `` and start it at >> ``; see linkgit:git-branch[1] for details. > > The names in the description need fixing too: s/_/-/g Ack > >> --B :: >> +-B :: >> Creates the branch `` and start it at ``; >> if it already exists, then reset it to ``. This is >> equivalent to running "git branch" with "-f"; see > > Likewise: s/_/-/g Ack > >> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt >> @@ -9,20 +9,20 @@ git-config - Get and set repository or global options >> -'git config' [] [--type=] [-z|--null] --get-urlmatch name URL >> +'git config' [] [--type=] [-z|--null] --get-urlmatch > > The commit message talks about using lowercase, so perhaps? s/URL/url/ URL is not a word, but an acronym. Lowercasing it looks weird, but that's personal taste. URL appears with a lot different casings across the documents. > >> @@ -102,7 +102,7 @@ OPTIONS >> ---get-urlmatch name URL:: >> +--get-urlmatch :: >> When given a two-part name section.key, the value for >> section..key whose part matches the best to the >> given URL is returned (if no such key exists, the value for > > Ditto. In fact, lowercase is already used in the description, > but not in the item line. > > If wanting to match other documentation files, this would also be > typeset as `` rather than in the description text, but that > change may be well outside the scope of this patch. > >> @@ -145,7 +145,7 @@ See also <>. >> --f config-file:: >> +-f :: >> --file config-file:: > > Need to apply brackets around `config-file` for the `--file` option > too, just as you did for short `-f`. > >> @@ -246,7 +246,7 @@ Valid ``'s include: >> ---get-colorbool name [stdout-is-tty]:: >> +--get-colorbool []:: >> >> Find the color setting for `name` (e.g. `color.diff`) and output >> "true" or "false". `stdout-is-tty` should be either "true" or > > Should you wrap `stdout-is-tty` within angle brackets within the > description too? > The rules for referring to placeholder in text wasn't defined (use angle brackets or not, use monospace or not) . Usage in manpages is diverse. Logically this would be monospace for any token of the synopsis and angle bracket when it's a placeholder. However, this is a larger fixup in manpages, that would require its own patch. >> @@ -257,7 +257,7 @@ Valid ``'s include: >> ---get-color name [default]:: >> +--get-color []:: >> >> Find the color configured for `name` (e.g. `color.diff.new`) and >> output it as the ANSI color escape sequence to the standard > > And here? rather than `name`? > >> diff --git a/Documentation/git-credential.txt b/Documentation/git-credential.txt >> @@ -8,7 +8,7 @@ git-credential - Retrieve and store user credentials >> -git credential >> +git credential [fill|approve|reject] > > The original was indeed wrong but the revised text is also slightly > misleading. The square brackets suggest that the "action" is optional, > but in fact it's not, so this should be using parentheses: > > git credential (fill|approve|reject) > > Also, the usage text in builtin/credential.c is wrong: > > % git credential > usage: git credential [fill|approve|reject] > > It should be using parentheses, as well, but fixing that may be > outside the scope of this patch (and can be done later). > >> diff --git 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 >> -'git cvsimport' [-o ] [-h] [-v] [-d ] >> +'git cvsimport' [-o ] [-h] [-v] [-d ] >> [-A ] [-p ] [-P ] >> - [-C ] [-z ] [-i] [-k] [-u] [-s ] >> + [-C ] [-z ] [-i] [-k] [-u] [-s ] >> [-a] [-m] [-M ] [-S ] [-L ] >> - [-r ] [-R] [] >> + [-r ] [-R] [] > > I wonder if should be changed to ? > >> diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt >> @@ -12,7 +12,7 @@ SYNOPSIS >> 'git fsck' [--tags] [--root] [--unreachable] [--cache] [--no-reflogs] >> [--[no-]full] [--strict] [--verbose] [--lost-found] >> [--[no-]dangling] [--[no-]progress] [--connectivity-only] >> - [--[no-]name-objects] [*] >> + [--[no-]name-objects] [...] > > Okay. > >> diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt >> @@ -79,7 +79,7 @@ repository. If not specified, fall back to the default name (currently >> ---shared[=(false|true|umask|group|all|world|everybody|0xxx)]:: >> +--shared[=(false|true|umask|group|all|world|everybody|0)]:: > > This feels slightly unusual; I'd have expected just plain `` > without the leading `0`, and... > >> @@ -110,13 +110,14 @@ the repository permissions. >> -'0xxx':: >> +'0':: > > .. this would also say just ``, and... > >> -'0xxx' is an octal number and each file will have mode '0xxx'. '0xxx' will >> -override users' umask(2) value (and not only loosen permissions as 'group' and >> -'all' does). '0640' will create a repository which is group-readable, but not >> -group-writable or accessible to others. '0660' will create a repo that is >> -readable and writable to the current user and group, but inaccessible to others. >> +'0' is an octal number and each file will have mode >> +'0'. '0' will override users' umask(2) value (and not >> +only loosen permissions as 'group' and 'all' does). '0640' will create >> +a repository which is group-readable, but not group-writable or >> +accessible to others. '0660' will create a repo that is readable and >> +writable to the current user and group, but inaccessible to others. > > ... this would then go on to explain that `` "... is an octal > number starting with literal `0`...". > > But it's subjective and others might feel differently. > >> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt >> @@ -81,7 +81,7 @@ produced by `--stat`, etc. >> -:: >> +:: >> Show only commits in the specified revision range. When no >> is specified, it defaults to `HEAD` (i.e. the >> whole history leading to the current commit). `origin..HEAD` > > Also need to fix the description: s/// > >> diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt >> @@ -10,8 +10,8 @@ SYNOPSIS >> 'git ls-files' [-z] [-t] [-v] [-f] >> - (--[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)...] > > I wonder if we could make it easier on users if written like this: > > [--cached|--deleted|--others|--blah|--blah]... > [-c|-d|-o|-i|-s|-u|-k|-m]... > > But that's subjective. It would better match synopsis of other commands with the following grammar which expresses alternative options as explained in the remainder of the manpage: [-c|--cached] [-d|--deleted] [-m|--modified] and so on. > >> diff --git a/Documentation/git-pack-redundant.txt b/Documentation/git-pack-redundant.txt >> @@ -9,7 +9,7 @@ git-pack-redundant - Find redundant pack files >> -'git pack-redundant' [ --verbose ] [ --alt-odb ] < --all | .pack filename ... > >> +'git pack-redundant' [ --verbose ] [ --alt-odb ] ( --all | <.pack-filename>... ) > > I'd probably drop the leading dot in <.pack-filename>. It shouldn't be > difficult for a reader to figure out that these are the files with > `.pack` extension, and if they do need help understanding that, then > probably better to explain in prose that is a pack > file with `.pack` extension. > >> diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt >> @@ -89,7 +89,7 @@ counts both authors and co-authors. >> -:: >> +:: >> Show only commits in the specified revision range. When no >> is specified, it defaults to `HEAD` (i.e. the >> whole history leading to the current commit). `origin..HEAD` > > Need to update the description to: s/// Ack > >> diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt >> @@ -11,7 +11,7 @@ given by a list of patterns. >> -'git sparse-checkout [options]' >> +'git sparse-checkout [...]' > > The addition of `...` would make more sense if it was spelled > "option", but with it already being plural "options", I have trouble > understanding why `...` is added. > >> diff --git a/Documentation/git-stage.txt b/Documentation/git-stage.txt >> @@ -9,7 +9,7 @@ git-stage - Add file contents to the staging area >> -'git stage' args... >> +'git stage' ... > > It's subjective, but I find plain `` easier to interpret than > `...`. Does our documentation favor one form over the other, or > is there a random mix? > >> diff --git a/Documentation/git-web--browse.txt b/Documentation/git-web--browse.txt >> @@ -8,7 +8,7 @@ git-web--browse - Git helper script to launch a web browser >> -'git web{litdd}browse' [] ... >> +'git web{litdd}browse' [] (|)... > > Good. >