user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/6] searchidx: index_diff: allow /^$/ line as diff context
  2020-01-03  8:45  4% [PATCH 0/6] searchidx: minor fix and some cleanups Eric Wong
@ 2020-01-03  8:45  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-01-03  8:45 UTC (permalink / raw)
  To: meta

As discovered by solver bug hunting, "git apply" also handles
the case where blank lines w/o leading space are treated as diff
context, apparently because GNU diff once did it:

https://public-inbox.org/git/b507b465f7831612b9d9fc643e3e5218b64e5bfa/s/
---
 lib/PublicInbox/SearchIdx.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 21ab8119..4cfbc4aa 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -255,7 +255,9 @@ sub index_diff ($$$) {
 				/^Binary files .* differ/) {
 			push @xnq, $_;
 		} elsif ($_ eq '') {
-			$in_diff = undef;
+			# possible to be in diff context, some mail may be
+			# stripped by MUA or even GNU diff(1).  "git apply"
+			# treats a bare "\n" as diff context, too
 		} else {
 			push @xnq, $_;
 			warn "non-diff line: $_\n" if DEBUG && $_ ne '';

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/6] searchidx: minor fix and some cleanups
@ 2020-01-03  8:45  4% Eric Wong
  2020-01-03  8:45  7% ` [PATCH 1/6] searchidx: index_diff: allow /^$/ line as diff context Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-01-03  8:45 UTC (permalink / raw)
  To: meta

1/6 is a real bug fix, 4/6 is a nice simplification
and the rest makes reading easier when I haven't looked
at the indexing code in a while.

Xapian indexing is still expensive, though...

Eric Wong (6):
  searchidx: index_diff: allow /^$/ line as diff context
  searchidx: split off index_xapian for msg_iter
  searchidx: add_message: fix and make use of prototypes
  searchidx: simplify quote-splitting in index_body
  searchidx: index_text: use Xapian parameter names
  searchidx: remove_message: pedantic fix for v1

 lib/PublicInbox/SearchIdx.pm | 177 ++++++++++++++++-------------------
 1 file changed, 83 insertions(+), 94 deletions(-)


^ permalink raw reply	[relevance 4%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-01-03  8:45  4% [PATCH 0/6] searchidx: minor fix and some cleanups Eric Wong
2020-01-03  8:45  7% ` [PATCH 1/6] searchidx: index_diff: allow /^$/ line as diff context Eric Wong

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).