Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tim Henigan <tim.henigan@gmail.com>
Cc: Nanako Shiraishi <nanako3@lavabit.com>,
	jrnieder@gmail.com, git@vger.kernel.org
Subject: Re: [PATCH v4] git remote: Separate usage strings for subcommands
Date: Thu, 19 Nov 2009 10:10:44 -0800	[thread overview]
Message-ID: <7vlji2bd23.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 32c343770911190651w3f1ac9b6i2d3b1a62a032489f@mail.gmail.com

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...

    > ... hunk to remove literal strings from builtin_remote_usage[] 
    > ... and replace them with REMOTE_BARE_USAGE, REMOTE_ADD_USAGE

    I am not sure about the value of reusing option string like this, and for

Here, please note that I was objecting to the use of _the same string_ in
both contexts ("reusing").

    all other subcommands the same comment applies.  For example, in the case
    of "remote add -h", you would use

    "git remote add [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>"

    from REMOTE_ADD_USAGE, but ...

    > ... hunk to give the builtin_remote_add_usage[] that  uses the same
    > ... REMOTE_ADD_USAGE to parse_options() 

    ... 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.

In your response to my above comment, you indicated that you wanted to do
the [<options>] thing as a separate patch (your original patch spelled
options in full).  I took it to mean that you would do that only for the
subcommand help, and did not respond, because

 (1) doing that to the subcommand help would be a good idea anyway; and

 (2) you will realize what I said in the message about "the value of
     reusing option string" was correct when you see the end result, which
     will regress "remote -h" output.

In this case, unfortunately (2) didn't happen before Nana pointed it out.

  reply	other threads:[~2009-11-19 18:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19  2:59 [PATCH v4] git remote: Separate usage strings for subcommands Tim Henigan
2009-11-19  3:40 ` Nanako Shiraishi
2009-11-19 14:51   ` Tim Henigan
2009-11-19 18:10     ` Junio C Hamano [this message]
2009-11-19 18:58       ` Tim Henigan
2009-11-20  9:36         ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vlji2bd23.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=nanako3@lavabit.com \
    --cc=tim.henigan@gmail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox