git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Regression in git log with multiple authors
@ 2010-08-26 17:39 Emil Sit
  2010-08-26 19:05 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Emil Sit @ 2010-08-26 17:39 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Commit 80235ba79ef43349f455cce869397b3e726f4058 introduced a
regression in a corner case for git log --author when multiple authors
are specified.  Prior to 1.7.0.3, if I wanted to find all commits done
by a series of authors, I could simply specify "git log --author=a1
--author=a2" to get all commits done by a1 and a2.  However, in the
latest releases, this finds nothing.

Here's a simple test case that demonstrates this:

diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 023f225..587069c 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -372,6 +372,14 @@ test_expect_success 'log --grep --author
implicitly uses all-match' '
        test_cmp expect actual
 '

+test_expect_success 'log --author --author matches both authors' '
+       # author matches only initial and third
+       # frotz matches only second
+       git log --author="A U Thor" --author="frotz\.com>$"
--format=%s >actual &&
+        ( echo third ; echo second ; echo initial ) >expect &&
+       test_cmp expect actual
+'
+
 test_expect_success 'grep with CE_VALID file' '
        git update-index --assume-unchanged t/t &&
        rm t/t &&

This fails against master, but if you revert 80235ba, this will pass
(whereas obviously 'log --grep --author implicitly uses all-match'
will then fail).

It doesn't seem like I can work-around this with 'git log --author a1
--or --author a2'.  Is there some other way to find commits by a set
of authors? I don't think it makes sense to treat multiple --author
flags with "and' logic since a commit can only have one author.  So
maybe all --authors should be grouped with ors and then anded against
all --committers?

-- 
Emil Sit / http://www.emilsit.net/

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-13 18:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-26 17:39 Regression in git log with multiple authors Emil Sit
2010-08-26 19:05 ` Junio C Hamano
2010-09-13  8:13   ` [PATCH 1/2] grep: move logic to compile header pattern into a separate helper Junio C Hamano
2010-09-13  8:18   ` [PATCH 2/2] log --author: take union of multiple "author" requests Junio C Hamano
2010-09-13 16:17     ` Emil Sit
2010-09-13 18:11       ` Junio C Hamano

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).