git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] Allow "git log --grep foo" as synonym for "git  log --grep=foo".
Date: Tue, 27 Jul 2010 10:18:03 +0000	[thread overview]
Message-ID: <AANLkTim1S_IYbPArQqX91OOPtoh2-rIWmTRon50_j2p3@mail.gmail.com> (raw)
In-Reply-To: <1280168078-31147-2-git-send-email-Matthieu.Moy@imag.fr>

On Mon, Jul 26, 2010 at 18:14, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:

> +       } else if (!strcmp(arg, "--grep")) {
> +               add_message_grep(revs, optarg);
> +               return 2;

This looks good. I've been bitten by git-log's non-standard option
parsing. But there's still a lot of options that need the =, no?:

    21 matches for "="" in buffer: revision.c

                     1163:    if (!prefixcmp(arg, "--max-count=")) {
       1166:    } else if (!prefixcmp(arg, "--skip=")) {
       1181:    } else if (!prefixcmp(arg, "--max-age=")) {
       1183:    } else if (!prefixcmp(arg, "--since=")) {
       1185:    } else if (!prefixcmp(arg, "--after=")) {
       1187:    } else if (!prefixcmp(arg, "--min-age=")) {
       1189:    } else if (!prefixcmp(arg, "--before=")) {
       1191:    } else if (!prefixcmp(arg, "--until=")) {
       1272:    } else if (!prefixcmp(arg, "--unpacked=")) {
       1297:    } else if (!prefixcmp(arg, "--pretty=") ||
!prefixcmp(arg, "--format=")) {
       1304:    } else if (!prefixcmp(arg, "--show-notes=")) {
       1346:    } else if (!prefixcmp(arg, "--abbrev=")) {
       1362:    } else if (!strncmp(arg, "--date=", 7)) {
       1371:    else if (!prefixcmp(arg, "--author=")) {
       1373:    } else if (!prefixcmp(arg, "--committer=")) {
       1375:    } else if (!prefixcmp(arg, "--grep=")) {
       1385:    } else if (!prefixcmp(arg, "--encoding=")) {
       1515:            if (!prefixcmp(arg, "--glob=")) {
       1521:            if (!prefixcmp(arg, "--branches=")) {
       1527:            if (!prefixcmp(arg, "--tags=")) {
       1533:            if (!prefixcmp(arg, "--remotes=")) {

I think changing the option parsing so that it handles all the long
options consistently would be very nice (along with some tests). But
just making --grep a special case is more confusing than requiring =
everywhere.

  parent reply	other threads:[~2010-07-27 10:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 18:14 [RFC PATCH 0/2] Allow detached forms (--option arg) for git log options Matthieu Moy
2010-07-26 18:14 ` [RFC PATCH 1/2] Allow "git log --grep foo" as synonym for "git log --grep=foo" Matthieu Moy
2010-07-27  6:43   ` Sverre Rabbelier
2010-07-27  8:40     ` Miles Bader
2010-07-27 10:24       ` Jakub Narebski
2010-07-27  8:45     ` Matthieu Moy
2010-07-27 10:18   ` Ævar Arnfjörð Bjarmason [this message]
2010-07-27 11:56     ` Matthieu Moy
2010-07-27 12:21       ` Ævar Arnfjörð Bjarmason
2010-07-27 13:26         ` Matthieu Moy
2010-07-27 13:46           ` Ævar Arnfjörð Bjarmason
2010-07-26 18:14 ` [RFC PATCH 2/2] Allow "git log -S string" as synonym for "git log -Sstring" Matthieu Moy
2010-07-27  6:42   ` Sverre Rabbelier
2010-07-26 19:31 ` [RFC PATCH 0/2] Allow detached forms (--option arg) for git log options Jonathan Nieder
2010-07-27 14:46   ` Pierre Habouzit
2010-07-27 15:10     ` Jakub Narebski
2010-07-28 13:06       ` Pierre Habouzit
2010-07-29  9:16         ` Jakub Narebski
2010-07-29 18:33           ` Pierre Habouzit
2010-08-01  5:24         ` Jonathan Nieder

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=AANLkTim1S_IYbPArQqX91OOPtoh2-rIWmTRon50_j2p3@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    /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).