From: Anthony Sottile <asottile@umich.edu>
To: git@vger.kernel.org
Subject: bug: `git log --grep ... --invert-grep --author=...` negates / ignores --author
Date: Wed, 31 May 2017 08:45:31 -0700 [thread overview]
Message-ID: <CA+dzEBn4EKzDqS0pCHHsPtGGJc1orf5weKKh0GN-GkE+fVYGcg@mail.gmail.com> (raw)
Given the following commits:
```
asottile@asottile-VirtualBox:/tmp$ git init test
Initialized empty Git repository in /tmp/test/.git/
asottile@asottile-VirtualBox:/tmp$ cd test/
asottile@asottile-VirtualBox:/tmp/test$
GIT_COMMITTER_EMAIL=foo@example.com GIT_AUTHOR_EMAIL=foo@example.com
git commit --allow-empty -m "foo"
[master (root-commit) c9df62b] foo
asottile@asottile-VirtualBox:/tmp/test$ git commit -m "blah" --allow-empty
[master 9e3ee9b] blah
asottile@asottile-VirtualBox:/tmp/test$ git log
commit 9e3ee9bc1adab2ae8eb1884a8f6237da18dfd27b
Author: Anthony Sottile <asottile@umich.edu>
Date: Wed May 31 08:40:59 2017 -0700
blah
commit c9df62b93298a247fcfbe24ed4282ccf95448f47
Author: Anthony Sottile <foo@example.com>
Date: Wed May 31 08:40:49 2017 -0700
foo
asottile@asottile-VirtualBox:/tmp/test$ git log --grep bar
--invert-grep --author=foo
commit 9e3ee9bc1adab2ae8eb1884a8f6237da18dfd27b
Author: Anthony Sottile <asottile@umich.edu>
Date: Wed May 31 08:40:59 2017 -0700
blah
commit c9df62b93298a247fcfbe24ed4282ccf95448f47
Author: Anthony Sottile <foo@example.com>
Date: Wed May 31 08:40:49 2017 -0700
foo
asottile@asottile-VirtualBox:/tmp/test$ git log --author=foocommit
c9df62b93298a247fcfbe24ed4282ccf95448f47
Author: Anthony Sottile <foo@example.com>
Date: Wed May 31 08:40:49 2017 -0700
foo
```
I expect the same output from the last two commands, but the
`--invert-grep` one seems to match _all_ the commits.
I can try and dig into this if I have time, just trying to get a count
using this as a workaround
git log --grep ... --invert-grep --format=%ce | grep ... | wc -l
Anthony
next reply other threads:[~2017-05-31 15:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 15:45 Anthony Sottile [this message]
2017-05-31 18:08 ` bug: `git log --grep ... --invert-grep --author=...` negates / ignores --author Ævar Arnfjörð Bjarmason
2017-05-31 21:40 ` Jeff King
2017-06-01 19:45 ` Ævar Arnfjörð Bjarmason
2017-06-01 21:05 ` Anthony Sottile
2017-06-01 21:38 ` Junio C Hamano
2017-06-01 2:20 ` 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=CA+dzEBn4EKzDqS0pCHHsPtGGJc1orf5weKKh0GN-GkE+fVYGcg@mail.gmail.com \
--to=asottile@umich.edu \
--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).