user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Rob Herring <robh@kernel.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	meta@public-inbox.org
Subject: [PATCH] searchidx: index "diff --git a/... b/..." headers
Date: Mon, 8 Nov 2021 21:27:14 +0000	[thread overview]
Message-ID: <20211108212714.GA13642@dcvr> (raw)
In-Reply-To: <CAL_Jsq+XtqOEF7p5zbO2O2YdHPr61+ahPgdDhH7_XMwyuDuc2w@mail.gmail.com>

Rob Herring <robh@kernel.org> wrote:
> On Mon, Nov 8, 2021 at 2:22 PM Konstantin Ryabitsev
> > I think 's:patch AND nq:diff' is a good option here.
> 
> Not even close really. That mainly finds my replies with 'diff' in
> them. I'm not sure why, but it misses most actual patches:
> 
> https://lore.kernel.org/all/?q=s%3Apatch+nq%3Adiff+f%3Arobh%40kernel.org

Actually, it looks like nq:diff never works.  The diff indexer
skips right over 'diff --git a/... b/...' lines :x

The following should fix it, but reindexing is necessary.
---------8<----------
Subject: [PATCH] searchidx: index "diff --git a/... b/..." headers

While we do detailed indexing of git diffs, the header itself
was failing and queries like 'nq:diff' would not work.

Noticed-by: Rob Herring <robh@kernel.org>
---
 lib/PublicInbox/SearchIdx.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index b886ce78..6e2e614c 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -259,6 +259,7 @@ sub index_diff ($$$) {
 		} elsif (m!^diff --git "?[^/]+/.+ "?[^/]+/.+\z!) {
 			# wait until "---" and "+++" to capture filenames
 			$in_diff = 1;
+			push @xnq, $_;
 		# traditional diff:
 		} elsif (m/^diff -(.+) (\S+) (\S+)$/) {
 			my ($opt, $fa, $fb) = ($1, $2, $3);

  reply	other threads:[~2021-11-08 21:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <lorelei.part1.202111051304.mdtebsxahljcrxak@meerkat.local>
     [not found] ` <CAL_JsqJBh1O3H2-P07AHzVq0x89BoP_N6P=rT5up6=3QyF_B0Q@mail.gmail.com>
2021-11-08 20:22   ` lei: incorrect quoting on saved searches (was Re: lore+lei: getting started) Konstantin Ryabitsev
2021-11-08 20:49     ` Eric Wong
2021-11-08 21:36       ` Konstantin Ryabitsev
2021-11-08 21:48         ` Eric Wong
2021-11-08 22:36           ` Konstantin Ryabitsev
2021-11-08 22:57             ` Eric Wong
2021-11-08 20:53     ` Rob Herring
2021-11-08 21:27       ` Eric Wong [this message]
2021-11-09  0:38         ` [PATCH] searchidx: index "diff --git a/... b/..." headers Rob Herring
2021-11-09  3:12           ` Eric Wong
2021-11-09  4:03             ` Rob Herring
2021-11-09  5:08               ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211108212714.GA13642@dcvr \
    --to=e@80x24.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=meta@public-inbox.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).