All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Trojanowski <bart@jukie.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add git-rev-list --invert-match
Date: Thu, 20 Sep 2007 08:38:49 -0400	[thread overview]
Message-ID: <20070920123849.GD12076@jukie.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0709201132381.28395@racer.site>

* Johannes Schindelin <Johannes.Schindelin@gmx.de> [070920 06:34]:
> On Wed, 19 Sep 2007, Bart Trojanowski wrote:
> >   git log --invert-match --grep="uninteresting"
> 
> IMHO this is only half a solution.  Some of us want to say "git log 
> --grep=this --but-not-(in-the-whole-message) --grep=that".

I have noticed that unique negation flags are getting scarce... we
already have --reverse, --inverse, and --not  mean something elsewhere.
--but-not maybe be good.

I also agree that git-grep could use this extension.

Anyways, I can see four solutions for adding "show me this but not that"
functionality to git-rev-list:

 1) adding a --but-not flag, as you suggested.  It separates positive
    matches that precede it with negative matches that follow.

  Example:
    git log --grep=this --but-not --grep=that --committer="${MY_EMAIL}"

 2) Adding --not-grep, --not-author, --not-committer which add negative
    matches.  Maybe even --grep!=PATTERN, --author!=PATTERN, ...

  Example:
    git log --grep=this --not-grep=that --committer!="${MY_EMAIL}"

 3) Extending the PATTERN we accept in --grep, --author, and --committer,
    such that a prefix in the pattern tells us how to use the match:
    --grep=!PATTERN

  Example:
    git log --grep=this --grep='!that' --committer="!${MY_EMAIL}"

 4) (going on a limb here) Can this kind of match be done with perl
    regular expressions?  Maybe we could use --perl-regexp

  Example:
    I've got nothing :)

Personally I am currently in favour of 2.  It seems intuitive, and
unlike option 3, the '!' cannot clash with the pattern.  Although 3 has
the bonus of allowing other flags like extended regexp, perl regexp,
case insensitive, negation, etc.

Comments?

-Bart

-- 
				WebSig: http://www.jukie.net/~bart/sig/

  reply	other threads:[~2007-09-20 12:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 20:26 [PATCH] Add git-rev-list --invert-match Bart Trojanowski
2007-09-20  2:52 ` Bart Trojanowski
2007-09-20  4:05   ` Junio C Hamano
2007-09-20 12:18     ` Bart Trojanowski
2007-09-20 10:32 ` Johannes Schindelin
2007-09-20 12:38   ` Bart Trojanowski [this message]
2007-09-20 13:12     ` Johannes Schindelin
2007-09-20 21:49       ` Junio C Hamano
2007-09-20 21:54         ` Johannes Schindelin
2007-09-22  1:38           ` [RFC] Add git-rev-list --not-(author|committer|grep)!=pattern Bart Trojanowski
2007-09-21  4:18       ` [PATCH] Add git-rev-list --invert-match Jeff King
2007-09-21  9:10         ` Johannes Schindelin
2007-09-21  9:19           ` Jeff King

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=20070920123849.GD12076@jukie.net \
    --to=bart@jukie.net \
    --cc=Johannes.Schindelin@gmx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.