]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Search.pm
search: allow searching within mail diffs
[public-inbox.git] / lib / PublicInbox / Search.pm
index 67837f4f77300e6ef76333c623cb07eeca24ea30..c7c5455d744d6fab782572c9f0af2848b55f5769 100644 (file)
@@ -75,6 +75,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',
@@ -98,12 +106,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');