git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dotan Cohen <dotancohen@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Git bug: Filter ignored when "--invert-grep" option is used.
Date: Thu, 16 Dec 2021 11:42:24 -0800	[thread overview]
Message-ID: <xmqqee6cbalb.fsf@gitster.g> (raw)
In-Reply-To: <CAKDXFkOXNPTjQRvj7sy54YhH1QGFUsEXYeLKCShJP7_xueRseQ@mail.gmail.com> (Dotan Cohen's message of "Thu, 16 Dec 2021 16:54:39 +0200")

Dotan Cohen <dotancohen@gmail.com> writes:

>> I think --author and --grep uses the same internal pattern matching
>> engine, so with --invert-grep, I would not be surprised if the
>> command looks for commits that do not have Revert and (or is that
>> or?  I dunno) not authored by Shachar.
>
> Possibly, but the flag is called --invert-grep not --invert-matches so
> one would expect it to revert grep only.

That is an actionable improvement idea to introduce a synonym ;-)

But in general, the way the internal "git grep" machinery is exposed
to the commands in the "git log" family is very limited.  With "git
grep", it is quite straight-forward to say "report hits for lines
that has this but not that"

    $ git grep -e this --and --not -e that

but because that the commands in the "log" family already use
"--not" for a quite different purpose, "git log --grep" cannot even
express something similar, even to find hits on a single line, let
alone finding hits on two different lines (i.e. one on the "author"
header, the other in the message part, of the commit object).



  reply	other threads:[~2021-12-16 19:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15  9:50 Git bug: Filter ignored when "--invert-grep" option is used Dotan Cohen
2021-12-15 22:08 ` Junio C Hamano
2021-12-16 14:54   ` Dotan Cohen
2021-12-16 19:42     ` Junio C Hamano [this message]
2021-12-17 16:48       ` René Scharfe
2021-12-17 18:16         ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqee6cbalb.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=dotancohen@gmail.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).