git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lodato <lodatom@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH] Add an optional argument for --color options
Date: Sun, 14 Feb 2010 09:58:58 -0500	[thread overview]
Message-ID: <ca433831002140658r30aa539fy5480cae8298d6d6c@mail.gmail.com> (raw)
In-Reply-To: <20100214064408.GB20630@coredump.intra.peff.net>

On Sun, Feb 14, 2010 at 1:44 AM, Jeff King <peff@peff.net> wrote:
> On Sat, Feb 13, 2010 at 05:01:15PM -0500, Mark Lodato wrote:
>
>> If the argument is not valid for a diff-family program, a completely
>> unhelpful usage message is shown.  It seems that all the other diff
>> options silently ignore invalid inputs, so this is consistent.  Perhaps
>> this aspect should be tweaked.
>
> Hmm...the only one I see that silently ignores is "--submodule=bogus".
> But it seems that "git log -Bfoobar" fails but does not print a useful
> message.  Probably both should be fixed, and your option should follow
> the same convention as those.

Just wondering, why does diff use a separate option parsing mechanism
than the rest of the code?  Would it be worthwhile to switch to
parse_opt?  This may make the code cleaner, and it would definitely
make the command-line interface more consistent with the rest of the
suite.  From a user's point of view, the biggest win would be "-h"
printing all of the options, like all the non-diff commands do.

> My only complaint in that respect is that there are no tests.  However,
> I'm not sure we can get a very satisfying test, since the test scripts
> may or may not have stdout going to a tty.

Perhaps I can throw the tests in Jonathan's "tests for automatic use
of pager", t7006-pager?  Or, create a new test that mimics his?

Thanks for the feedback,
Mark

  parent reply	other threads:[~2010-02-14 14:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13 22:01 [PATCH] Add an optional argument for --color options Mark Lodato
2010-02-14  6:44 ` Jeff King
2010-02-14 12:21   ` Jonathan Nieder
2010-02-14 14:58   ` Mark Lodato [this message]
2010-02-15  1:18     ` Jonathan Nieder
2010-02-15  5:23       ` Jeff King
2010-02-15  1:23     ` Usage messages produced by parseopt (Re: [PATCH] Add an optional argument for --color options) Jonathan Nieder
2010-02-15  5:21     ` [PATCH] Add an optional argument for --color options Jeff King
2010-02-15  6:02       ` Junio C Hamano
2010-02-14 11:39 ` Junio C Hamano
2010-02-14 14:46   ` Mark Lodato

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=ca433831002140658r30aa539fy5480cae8298d6d6c@mail.gmail.com \
    --to=lodatom@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /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;
as well as URLs for NNTP newsgroup(s).