git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Regression in git log with multiple authors

From
Emil Sit <sit@emilsit.net>
Date
Aug 26, 2010, 17:39 UTC
Message-ID
<AANLkTikONxneEgF5m+m6100pwzThTnaiAB+OFzYufcC2@mail.gmail.com>

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/
Next: Junio C Hamano
Message 1 of 6 in “Regression in git log with multiple authors”
  1. Emil SitAug 26, 2010
  2. Junio C HamanoAug 26, 2010
  3. 1/2 grep: move logic to compile header pattern into a separate helperJunio C Hamano, Sep 13, 2010
  4. 2/2 log --author: take union of multiple "author" requestsJunio C Hamano, Sep 13, 2010
  5. Emil SitSep 13, 2010
  6. Junio C HamanoSep 13, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.