From: Denton Liu <liu.denton@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] git-submodule.txt: fix AsciiDoc formatting error
Date: Fri, 13 Sep 2019 15:09:02 -0700 [thread overview]
Message-ID: <20190913220902.GA93452@dentonliu-ltm.internal.salesforce.com> (raw)
In-Reply-To: <xmqqk1acdqf8.fsf@gitster-ct.c.googlers.com>
On Fri, Sep 13, 2019 at 11:03:39AM -0700, Junio C Hamano wrote:
> Denton Liu <liu.denton@gmail.com> writes:
>
> > Remove surrounding parentheses so that the "index term" syntax is not
> > triggered (and because it looks nicer without them anyway ;) ).
>
> "Correct" always trumps "nicer", though ;-)
>
> The $USAGE string in the script describes the available options to
> this subcommand like so:
>
> or: $dashless [--quiet] set-branch (--default|--branch <branch>) [--] <path>
>
> which is, "you can give either --default or --branch <branch>, but
> not both". What the original, if there were no special meaning in
> double-paren, meant to say seems to (almost) match that.
>
> > -set-branch ((-d|--default)|(-b|--branch <branch>)) [--] <path>::
>
> I say "almost", as it gives a wrong impression that you can give
> "-b" without "<branch>" X-<.
>
> Now what does the updated text say to us?
>
> > +set-branch (-d|--default)|(-b|--branch <branch>) [--] <path>::
>
> I think the attempt to cram the short-form is unnecessarily
> cluttering and making the result incorrect. How about doing
> something like this instead?
>
> Documentation/git-submodule.txt | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
> index 0ed5c24dc1..816baa7dd0 100644
> --- a/Documentation/git-submodule.txt
> +++ b/Documentation/git-submodule.txt
> @@ -173,10 +173,12 @@ submodule with the `--init` option.
> If `--recursive` is specified, this command will recurse into the
> registered submodules, and update any nested submodules within.
> --
> -set-branch ((-d|--default)|(-b|--branch <branch>)) [--] <path>::
> +set-branch (--default|--branch <branch>) [--] <path>::
> Sets the default remote tracking branch for the submodule. The
> - `--branch` option allows the remote branch to be specified. The
> - `--default` option removes the submodule.<name>.branch configuration
> + `--branch` option (or its short-form, `-b <branch>`)
> + allows the remote branch to be specified. The
> + `--default` option (or its short-form, `-d`)
> + removes the submodule.<name>.branch configuration
> key, which causes the tracking branch to default to 'master'.
>
> summary [--cached|--files] [(-n|--summary-limit) <n>] [commit] [--] [<path>...]::
Hmm, I don't really like this since with every other subcommand, the
short-forms are in the command summary so it's obvious to the reader
in a quick glance which options are available. With this change, a
reader would have to not only read the summary line but also scan the
blurb below.
In the context line above, we see `[(-n|--summary-limit) <n>]` as a
possible way of notating a short and long option with argument. What do
you think about the following potential output?
set-branch (-d|--default)|((-b|--branch) <branch>) [--] <path>::
Of course, we reintroduce the double paren problem but I can dig into
asciidoc syntax and figure out how to escape it properly.
next prev parent reply other threads:[~2019-09-13 22:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-10 19:09 [PATCH] git-submodule.txt: fix AsciiDoc formatting error Denton Liu
2019-09-13 18:03 ` Junio C Hamano
2019-09-13 22:09 ` Denton Liu [this message]
2019-09-13 23:13 ` Junio C Hamano
2019-09-16 18:19 ` [PATCH v2] " Denton Liu
2019-09-16 19:25 ` 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
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=20190913220902.GA93452@dentonliu-ltm.internal.salesforce.com \
--to=liu.denton@gmail.com \
--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).