From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5431A1F54E; Tue, 19 Jul 2022 02:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1658198164; bh=7zN5fRLW3y1eAETPb9qFmJk7ukDh9u1vKbtG60EYguY=; h=From:To:Subject:Date:From; b=GuEmTERBtKlzW9R4F8g56/p5/Ar//rYe6mcOsZi9CT6e1MZ7slaeaaJcgcJQakt5v nxRpGUKGbsssiNXB403cMT9hhsRPFAcEuBbOGTeO0rwu78ZAv5bGys1X2t10s84jyk /3GEDxOyOolJm3gNz0i1QUePsk2Al7li0YQroAKs= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] searchidx: skip "delta $N" sections for base-85 Date: Tue, 19 Jul 2022 02:36:04 +0000 Message-Id: <20220719023604.1820350-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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