git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-submodule.txt: fix AsciiDoc formatting error

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 13, 2019, 23:13 UTC
Message-ID
<xmqq36gzdc30.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190913220902.GA93452@dentonliu-ltm.internal.salesforce.com>
Denton Liu <liu.denton@gmail.com> writes:
Show 16 quoted lines
>> > -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.
>>  ...
>> 
> 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.

I actually do not think it adds that much value. Once a user learns what --branch does and is told -b is its short form, it is much less important that -b and --branch are both available than --default and --branch are possibilities, and you cannot use both at the same time.

If anything, perhaps other subcommands' description may benefit if we unclutter by reducing the prominence we give to their short form.

Show 8 quoted lines
> 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.

That's much less important than the fact that you are losing "-b and -d cannot be used together", which is what the usage string gives us (and which is what I tried to express with my rewrite).

Previous: Denton LiuNext: Denton Liu
Message 4 of 6 in “git-submodule.txt: fix AsciiDoc formatting error”
  1. git-submodule.txt: fix AsciiDoc formatting errorDenton Liu, Sep 10, 2019
  2. Junio C HamanoSep 13, 2019
  3. Denton LiuSep 13, 2019
  4. Junio C HamanoSep 13, 2019
  5. git-submodule.txt: fix AsciiDoc formatting errorDenton Liu, Sep 16, 2019
  6. Junio C HamanoSep 16, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.