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

Re: [PATCH v4] git remote: Separate usage strings for subcommands

From
Tim Henigan <tim.henigan@gmail.com>
Date
Nov 19, 2009, 18:58 UTC
Message-ID
<32c343770911191058x7be7d34ascc3564064b880213@mail.gmail.com>
In-Reply-To
<7vlji2bd23.fsf@alter.siamese.dyndns.org>
On Thu, Nov 19, 2009 at 1:10 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Tim Henigan <tim.henigan@gmail.com> writes:
>
>> The original version of this patch [1] left the contents of the usage
>> strings intact.  However, Junio expressed a preference to change
>> them to use the generic <options>.  See this thread for the
>> discussion [2].
>>
>> [1] http://article.gmane.org/gmane.comp.version-control.git/133048/
>> [2] http://thread.gmane.org/gmane.comp.version-control.git/132968/focus=133050
>
> Sorry, but I think you misunderstood what I meant, then.  in [2], I said...
... snip ...
Show 11 quoted lines
>    ... the options list is used to reproduce the information in a major part
>    of that string already.  So I would prefer builtin_remote_add_usage[] to
>    be something like:
>
>        "git remote add [<options>...] <name> <url>"
>
> I meant that we want to change "remote add -h" to show this here; and the
> reason why I doubted "the value of reusing option string" was because I
> wanted to do so without touching the concise list of the subcommands and
> their options given by "remote -h".  Otherwise, it would have made perfect
> sense to use preprocessor macros to share the two identical strings.
Okay, I believe I understand now, but let's test that theory ;)
Using the 'add' subcommand as an example, the desired output is:
Output of 'git remote -h':
    "git remote [-v | --verbose]"
    "git remote add [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>"
    etc.
Output of 'git remote add -h':
    "git remote add [<options>...] <name> <url>"
    followed by the detailed description given by 'parse_options()'.
Text in 'man git-remote':
    "git remote add [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>"
    with the options explained in detail later in the file.

Thanks for your patience, Tim

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “git remote: Separate usage strings for subcommands”
  1. git remote: Separate usage strings for subcommandsTim Henigan, Nov 19, 2009
  2. Nanako ShiraishiNov 19, 2009
  3. Tim HeniganNov 19, 2009
  4. Junio C HamanoNov 19, 2009
  5. Tim HeniganNov 19, 2009
  6. Junio C HamanoNov 20, 2009

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.