aboutsummaryrefslogtreecommitdiff
path: root/entry.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-17 20:09:06 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-25 19:28:13 -0800
commit80235ba79ef43349f455cce869397b3e726f4058 (patch)
tree3ec0247fba884fe708ec771833a981cb4ebf61ea /entry.c
parentff6d26a0e1d8fad775010fa3b689c0c027da8bb0 (diff)
downloadgit-80235ba79ef43349f455cce869397b3e726f4058.tar.gz
git-80235ba79ef43349f455cce869397b3e726f4058.tar.xz
"log --author=me --grep=it" should find intersection, not union
Historically, any grep filter in "git log" family of commands were taken as restricting to commits with any of the words in the commit log message. However, the user almost always want to find commits "done by this person on that topic". With "--all-match" option, a series of grep patterns can be turned into a requirement that all of them must produce a match, but that makes it impossible to ask for "done by me, on either this or that" with: log --author=me --committer=him --grep=this --grep=that because it will require both "this" and "that" to appear. Change the "header" parser of grep library to treat the headers specially, and parse it as: (all-match-OR (HEADER-AUTHOR me) (HEADER-COMMITTER him) (OR (PATTERN this) (PATTERN that) ) ) Even though the "log" command line parser doesn't give direct access to the extended grep syntax to group terms with parentheses, this change will cover the majority of the case the users would want. This incidentally revealed that one test in t7002 was bogus. It ran: log --author=Thor --grep=Thu --format='%s' and expected (wrongly) "Thu" to match "Thursday" in the author/committer date, but that would never match, as the timestamp in raw commit buffer does not have the name of the day-of-the-week. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'entry.c')
0 files changed, 0 insertions, 0 deletions