user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Cc: Yaron Scheffer <yscheffer@protonmail.com>
Subject: [ssoma PATCH 1/2] extractor: warn about v2 repositories
Date: Wed, 19 Dec 2018 09:50:56 +0000	[thread overview]
Message-ID: <20181219095057.21862-2-e@80x24.org> (raw)
In-Reply-To: <20181219095057.21862-1-e@80x24.org>

ssoma was a misguided effort and won't be updated to support v2,
but at least spit out a warning about v2 repos.

Reported-by: Yaron Scheffer <yscheffer@protonmail.com>
---
 lib/Ssoma/Extractor.pm | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/Ssoma/Extractor.pm b/lib/Ssoma/Extractor.pm
index baf9adb..5c10eec 100644
--- a/lib/Ssoma/Extractor.pm
+++ b/lib/Ssoma/Extractor.pm
@@ -28,6 +28,17 @@ sub _flist {
 	\@rv
 }
 
+sub warn_v2 {
+	my ($self) = @_;
+	if (system('git cat-file blob HEAD:m >/dev/null 2>&1') == 0 ||
+	    system('git cat-file blob HEAD:d >/dev/null 2>&1') == 0) {
+		warn <<"";
+$self->{git}->{git_dir} looks like a public-inbox v2 repo.
+ssoma is deprecated and does not support v2 repositories
+
+	}
+}
+
 sub _extract {
 	my ($self, $target, $since) = @_;
 	my $git = $self->{git};
@@ -82,11 +93,16 @@ sub _extract {
 		# tricking us into extracting the same message twice;
 		# MDA will keep the original in sufficiently-identical messages
 		my $cmd = "git diff-tree -r --name-only -M100% --diff-filter=A";
-		$new = _flist("$cmd $last $tip");
+		$new = [];
+		if ($last ne $tip) {
+			$new = _flist("$cmd $last $tip");
+			warn_v2($self) unless scalar(@$new);
+		}
 	} else {
 		# new maildir or mbox (to us), import everything in the
 		# current tree
 		$new = _flist("git ls-tree -r --name-only $tip");
+		warn_v2($self) unless scalar(@$new);
 	}
 
 	my $i = 0;
-- 
EW


  reply	other threads:[~2018-12-19  9:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19  9:50 [ssoma PATCH 0/2] add warnings about lack of v2 support Eric Wong
2018-12-19  9:50 ` Eric Wong [this message]
2018-12-19  9:50 ` [ssoma PATCH 2/2] README: add warnings about the " 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

  List information: https://public-inbox.org/README

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

  git send-email \
    --in-reply-to=20181219095057.21862-2-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    --cc=yscheffer@protonmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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).