unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] searchidx: skip "delta $N" sections for base-85
Date: Tue, 19 Jul 2022 02:36:04 +0000	[thread overview]
Message-ID: <20220719023604.1820350-1-e@80x24.org> (raw)

I don't deal with binary patches ever, so I failed to notice
binary deltas are supported in addition to the more common
literals.

A quick check of apply.c in git.git confirms "delta" and
"literal" are the only binary patch classes we can expect.
---
 lib/PublicInbox/SearchIdx.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index cbfe7816..bdb84fc7 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -263,10 +263,10 @@ sub index_diff ($$$) {
 	while (defined($_ = shift @l)) {
 		if ($in_diff && /^GIT binary patch/) {
 			push @$xnq, $_;
-			while (@l && $l[0] =~ /^literal /) {
+			while (@l && $l[0] =~ /^(?:literal|delta) /) {
 				# TODO allow searching by size range?
 				# allows searching by exact size via:
-				# "literal $SIZE"
+				# "literal $SIZE" or "delta $SIZE"
 				push @$xnq, shift(@l);
 
 				# skip base85 and empty lines

                 reply	other threads:[~2022-07-19  2:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220719023604.1820350-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.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.
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).