From a88989cabe61c45d42146effe994d40dc57aec30 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 12 Apr 2017 20:17:47 +0000 Subject: search: allow searching within mail diffs This can be tied into a repository browser to browse in-flight topics on a mailing list. --- lib/PublicInbox/Search.pm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/Search.pm') diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index b0bfe232..ef5e1db0 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -74,6 +74,14 @@ my %prob_prefix = ( q => 'XQUOT', nq => 'XNQ', + dfn => 'XDFN', + dfa => 'XDFA', + dfb => 'XDFB', + dfhh => 'XDFHH', + dfctx => 'XDFCTX', + dfpre => 'XDFPRE', + dfpost => 'XDFPOST', + dfblob => 'XDFPRE XDFPOST', # default: '' => 'XMID S A XNQ XQUOT XFN', @@ -97,12 +105,16 @@ EOF 'a:' => 'match within the To, Cc, and From headers', 'tc:' => 'match within the To and Cc headers', 'bs:' => 'match within the Subject and body', + 'dfn:' => 'match filename from diff', + 'dfa:' => 'match diff removed (-) lines', + 'dfb:' => 'match diff added (+) lines', + 'dfhh:' => 'match diff hunk header context (usually a function name)', + 'dfctx:' => 'match diff context lines', + 'dfpre:' => 'match pre-image git blob ID', + 'dfpost:' => 'match post-image git blob ID', + 'dfblob:' => 'match either pre or post-image git blob ID', ); chomp @HELP; -# TODO: -# df (filenames from diff) -# da (diff a/ removed lines) -# db (diff b/ added lines) my $mail_query = Search::Xapian::Query->new('T' . 'mail'); -- cgit v1.2.3-24-ge0c7