user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/3] init: favor --skip-epoch instead of --skip
  2019-10-03  7:21  7% [PATCH 0/3] init: add manpage and locking Eric Wong
@ 2019-10-03  7:21  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-10-03  7:21 UTC (permalink / raw)
  To: meta

Since I intend to add support for --skip-artnum, disambiguating
the long option name makes sense.  We'll support --skip
indefinitely for compatibility.
---
 script/public-inbox-init | 15 ++++++++-------
 t/init.t                 |  6 +++---
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/script/public-inbox-init b/script/public-inbox-init
index 98aea4bf..39f2a067 100755
--- a/script/public-inbox-init
+++ b/script/public-inbox-init
@@ -20,10 +20,11 @@ sub x { system(@_) and die join(' ', @_). " failed: $?\n" }
 sub usage { print STDERR "Usage: $usage\n"; exit 1 }
 my $version = undef;
 my $indexlevel = undef;
-my $skip;
-my %opts = ( 'V|version=i' => \$version,
-	     'L|indexlevel=s' => \$indexlevel,
-	     'S|skip=i' => \$skip,
+my $skip_epoch;
+my %opts = (
+	'V|version=i' => \$version,
+	'L|indexlevel=s' => \$indexlevel,
+	'S|skip|skip-epoch=i' => \$skip_epoch,
 );
 GetOptions(%opts) or usage();
 PublicInbox::Admin::indexlevel_ok_or_die($indexlevel) if defined $indexlevel;
@@ -104,8 +105,8 @@ if (-f "$mainrepo/inbox.lock") {
 
 $version = 1 unless defined $version;
 
-if ($version == 1 && defined $skip) {
-	die "--skip is only supported for -V2 repos\n";
+if ($version == 1 && defined $skip_epoch) {
+	die "--skip-epoch is only supported for -V2 repos\n";
 }
 
 my $ibx = PublicInbox::Inbox->new({
@@ -117,7 +118,7 @@ my $ibx = PublicInbox::Inbox->new({
 });
 
 my $creat_opt = {};
-PublicInbox::InboxWritable->new($ibx, $creat_opt)->init_inbox(0, $skip);
+PublicInbox::InboxWritable->new($ibx, $creat_opt)->init_inbox(0, $skip_epoch);
 
 # needed for git prior to v2.1.0
 umask(0077) if defined $perm;
diff --git a/t/init.t b/t/init.t
index e2dd306d..667b09fe 100644
--- a/t/init.t
+++ b/t/init.t
@@ -86,15 +86,15 @@ SKIP: {
 	for (1..2) {
 		@cmd = (pi_init, '-V2', '-S1', 'skip1', "$tmpdir/skip1",
 			   qw(http://example.com/skip1 skip1@example.com));
-		is(system(@cmd), 0, "--skip 1");
+		is(system(@cmd), 0, "--skip-epoch 1");
 		my $gits = [ glob("$tmpdir/skip1/git/*.git") ];
 		is_deeply($gits, ["$tmpdir/skip1/git/1.git"], 'skip OK');
 	}
 
 
-	@cmd = (pi_init, '-V2', '--skip=2', 'skip2', "$tmpdir/skip2",
+	@cmd = (pi_init, '-V2', '--skip-epoch=2', 'skip2', "$tmpdir/skip2",
 		   qw(http://example.com/skip2 skip2@example.com));
-	is(system(@cmd), 0, "--skip 2");
+	is(system(@cmd), 0, "--skip-epoch 2");
 	my $gits = [ glob("$tmpdir/skip2/git/*.git") ];
 	is_deeply($gits, ["$tmpdir/skip2/git/2.git"], 'skipping 2 works, too');
 }
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/3] init: add manpage and locking
@ 2019-10-03  7:21  7% Eric Wong
  2019-10-03  7:21  7% ` [PATCH 1/3] init: favor --skip-epoch instead of --skip Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-10-03  7:21 UTC (permalink / raw)
  To: meta

And this reminds me, --skip-articles needs to be added for
--skip-epoch to make sense, too..

Eric Wong (3):
  init: favor --skip-epoch instead of --skip
  doc: add manpage for public-inbox-init(1)
  init: implement locking

 Documentation/include.mk            |  1 +
 Documentation/public-inbox-init.pod | 86 +++++++++++++++++++++++++++++
 MANIFEST                            |  1 +
 script/public-inbox-init            | 39 ++++++++++---
 t/init.t                            | 18 +++++-
 5 files changed, 135 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/public-inbox-init.pod

-- 
EW


^ permalink raw reply	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-10-03  7:21  7% [PATCH 0/3] init: add manpage and locking Eric Wong
2019-10-03  7:21  7% ` [PATCH 1/3] init: favor --skip-epoch instead of --skip Eric Wong

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