summaryrefslogtreecommitdiff
path: root/pack-write.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-01-17 20:09:06 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-01-25 19:28:13 -0800
commit80235ba79ef43349f455cce869397b3e726f4058 (patch)
tree3ec0247fba884fe708ec771833a981cb4ebf61ea /pack-write.c
parentUpdate draft release notes to 1.7.0 (diff)
downloadtgif-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 'pack-write.c')
0 files changed, 0 insertions, 0 deletions