From: Jeff King <peff@peff.net>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: gitster@pobox.com, git@vger.kernel.org,
Alastair McGowan-Douglas <altreus@altre.us>
Subject: Re: [PATCH 3/3] Documentation: make explicit that optional arguments must be stuck
Date: Fri, 18 Sep 2015 15:27:18 -0400 [thread overview]
Message-ID: <20150918192718.GE11068@sigill.intra.peff.net> (raw)
In-Reply-To: <1442588510-7379-4-git-send-email-Matthieu.Moy@imag.fr>
On Fri, Sep 18, 2015 at 05:01:50PM +0200, Matthieu Moy wrote:
> The behavior of command-line options with optional arguments is
> documented in gitcli(7), but it is easy for users to miss, and hard for
> the same user to understand why e.g. "git status -u no" does not work.
>
> Document this explicitly in the documentation of each short option having
> an optional argument: they are the most error prone since there is no '='
> sign between the option and its argument.
I like this. Even though it is redundant, it is getting information to
the place where users can see it, and I don't think it is so large as to
obscure the rest of the content.
> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
> index dbea6e7..5f0082e 100644
> --- a/Documentation/git-am.txt
> +++ b/Documentation/git-am.txt
> @@ -141,7 +141,8 @@ default. You can use `--no-utf8` to override this.
>
> -S[<keyid>]::
> --gpg-sign[=<keyid>]::
> - GPG-sign commits.
> + GPG-sign commits. The `keyid` argument is optional; if
> + specified, it must be stuck to the option without a space.
I think this wording is probably OK. At first I thought it was saying
the wrong thing for the long form ("stuck without a space" would mean
"--gpg-sign[keyid]"), but I think the syntax just above makes it pretty
clear.
> diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
> index 335f312..e1e8f57 100644
> --- a/Documentation/git-status.txt
> +++ b/Documentation/git-status.txt
> @@ -53,8 +53,9 @@ OPTIONS
> --untracked-files[=<mode>]::
> Show untracked files.
> +
> -The mode parameter is optional (defaults to 'all'), and is used to
> -specify the handling of untracked files.
> +The mode parameter is used to specify the handling of untracked files.
> +It is optional: it defaults to 'all', and if specified, it must be
> +stuck to the option (e.g. `-uno`, but not `-u no`).
I think this rearrangement makes the meaning much more clear overall.
-Peff
next prev parent reply other threads:[~2015-09-18 19:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 9:44 git status -u is mildly astonishing Alastair McGowan-Douglas
2015-09-17 14:27 ` Matthieu Moy
2015-09-17 17:43 ` Jeff King
2015-09-18 6:52 ` Matthieu Moy
2015-09-18 15:01 ` [PATCH 0/3] Clarify the documentation of options with optional arguments Matthieu Moy
2015-09-18 15:01 ` [PATCH 1/3] Documentation: use 'keyid' consistantly, not 'key-id' Matthieu Moy
2015-09-18 15:24 ` Matthieu Moy
2015-09-18 19:23 ` Jeff King
2015-09-18 15:01 ` [PATCH 2/3] Documentation/grep: fix documentation of -O Matthieu Moy
2015-09-18 15:01 ` [PATCH 3/3] Documentation: make explicit that optional arguments must be stuck Matthieu Moy
2015-09-18 19:27 ` Jeff King [this message]
2015-09-19 7:47 ` [PATCH v2 0/3] Clarify the documentation of options with optional arguments Matthieu Moy
2015-09-19 7:47 ` [PATCH v2 1/3] Documentation: use 'keyid' consistently, not 'key-id' Matthieu Moy
2015-09-19 7:47 ` [PATCH v2 2/3] Documentation/grep: fix documentation of -O Matthieu Moy
2015-09-19 7:47 ` [PATCH v2 3/3] Documentation: explain optional arguments better Matthieu Moy
2015-09-19 10:50 ` [PATCH v2 0/3] Clarify the documentation of options with optional arguments Jeff King
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150918192718.GE11068@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Matthieu.Moy@imag.fr \
--cc=altreus@altre.us \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
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).