From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6B8C21F461 for ; Fri, 15 Dec 2023 00:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1702598891; bh=7JnhKKAndhLf5Zewu732n05NumbzlpG3dj6sB/3eT0g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=3ovxDJn0/GjrbLDp1PxGCbMPADqxQ5whQyUa6BR0oO/oRvKFOfCTPC7X5X3tBylUk WcJiAy7nCvARfHmSYw2tOXW23aXHANYPeTAMtqEnLRGZ8/ZI+n/7CV/wgtF4jXCj00 6lZwRP6STxtaUc22HyfB/AT0FlZbX4eiNNy94J+g= From: Eric Wong To: spew@80x24.org Subject: [PATCH 3/5] cindex: --prune needs git 2.6+ Date: Thu, 14 Dec 2023 19:08:08 -0500 Message-Id: <20231215000810.3458531-3-e@80x24.org> In-Reply-To: <20231215000810.3458531-1-e@80x24.org> References: <20231215000810.3458531-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Older versions of git lack --batch-all-objects, and 2.6+ is new enough already since v2, lei, etc all depend on it. --- lib/PublicInbox/CodeSearchIdx.pm | 2 ++ t/cindex.t | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm index 5d420de2..570ff64f 100644 --- a/lib/PublicInbox/CodeSearchIdx.pm +++ b/lib/PublicInbox/CodeSearchIdx.pm @@ -1305,6 +1305,8 @@ sub cidx_run { # main entry point my $v = $self->{-opt}->{"sort-$_"}; push @SORT, "--$_=$v" if defined $v; } + ($self->{-opt}->{prune} && $GIT_VER le v2.6) and + die "W: --prune requires git v2.6+\n"; init_join_prefork($self) } local @IDX_SHARDS = cidx_init($self); # forks workers diff --git a/t/cindex.t b/t/cindex.t index ab4cde7c..e5f26ec3 100644 --- a/t/cindex.t +++ b/t/cindex.t @@ -209,6 +209,7 @@ EOM SKIP: { # --prune require_cmd($ENV{XAPIAN_DELVE} || 'xapian-delve', 1); + require_git v2.6, 1; my $csrch = PublicInbox::CodeSearch->new("$tmp/ext"); is(scalar($csrch->mset('s:hi')->items), 1, 'got hit');