From 7c0c47e26af17918031d449d24abe40ad452f51a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 19 Sep 2020 09:37:10 +0000 Subject: add gcf2 client and executable script This should be able to replace multiple `git cat-file' for blob retrieval, but adjustments may be needed. --- script/public-inbox-gcf2 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 script/public-inbox-gcf2 (limited to 'script') 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 +# License: AGPL-3.0+ +eval { require PublicInbox::Gcf2 }; +die "libgit2 development package or Inline::C missing for $0: $@\n" if $@; +my $gcf2 = PublicInbox::Gcf2::new(); +while () { + chomp; + if (m!\A/!) { # +/path/to/git-dir + $gcf2->add_alternate("$_/objects"); + } else { + $gcf2->cat_oid(1, $_); + } +} -- cgit v1.2.3-24-ge0c7