dumping ground for random patches and texts
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: spew@80x24.org
Subject: [PATCH 3/5] cindex: --prune needs git 2.6+
Date: Thu, 14 Dec 2023 19:08:08 -0500	[thread overview]
Message-ID: <20231215000810.3458531-3-e@80x24.org> (raw)
In-Reply-To: <20231215000810.3458531-1-e@80x24.org>

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');
 

  parent reply	other threads:[~2023-12-15  0:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15  0:08 [PATCH 1/5] tests: quiet uninitialized warnings on CentOS 7.x Eric Wong
2023-12-15  0:08 ` [PATCH 2/5] searchidx: quiet down old git patchid Eric Wong
2023-12-15  0:08 ` Eric Wong [this message]
2023-12-15  0:08 ` [PATCH 4/5] git: quiet down `rev-parse --git-path' errors Eric Wong
2023-12-15  0:08 ` [PATCH 5/5] t/pop3d-limit: use v1 inbox to test on ancient git 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

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

  git send-email \
    --in-reply-to=20231215000810.3458531-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=spew@80x24.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).