about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-09-19 09:37:10 +0000
committerEric Wong <e@80x24.org>2020-09-19 21:39:44 +0000
commit7c0c47e26af17918031d449d24abe40ad452f51a (patch)
treefddbc502ebf93260eb078d8490729ef4260739f2 /script
parent08259ae3cbc859aafa2a4bd79689b82b121ebf76 (diff)
downloadpublic-inbox-7c0c47e26af17918031d449d24abe40ad452f51a.tar.gz
This should be able to replace multiple `git cat-file' for blob
retrieval, but adjustments may be needed.
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-gcf214
1 files changed, 14 insertions, 0 deletions
diff --git a/script/public-inbox-gcf2 b/script/public-inbox-gcf2
new file mode 100755
index 00000000..51811698
--- /dev/null
+++ b/script/public-inbox-gcf2
@@ -0,0 +1,14 @@
+#!perl -w
+# Copyright (C) 2020 all contributors <meta@public-inbox.org>
+# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+eval { require PublicInbox::Gcf2 };
+die "libgit2 development package or Inline::C missing for $0: $@\n" if $@;
+my $gcf2 = PublicInbox::Gcf2::new();
+while (<STDIN>) {
+        chomp;
+        if (m!\A/!) { # +/path/to/git-dir
+                $gcf2->add_alternate("$_/objects");
+        } else {
+                $gcf2->cat_oid(1, $_);
+        }
+}