]> Sergey Matveev's repositories - public-inbox.git/commitdiff
index: s/GIT_DIR/REPO_DIR/
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Mon, 19 Mar 2018 08:14:50 +0000 (08:14 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Mon, 19 Mar 2018 08:16:34 +0000 (08:16 +0000)
No functional changes, yet, but this makes future changes
easier-to-read.

Documentation/public-inbox-index.pod
script/public-inbox-index

index 838a206919932e43061705981a240c1e55557146..acc903921e94e8a4a641fcc6c34b62a420e06872 100644 (file)
@@ -4,7 +4,7 @@ public-inbox-index - create and update search indices
 
 =head1 SYNOPSIS
 
-public-inbox-index [OPTIONS] GIT_DIR
+public-inbox-index [OPTIONS] REPO_DIR
 
 =head1 DESCRIPTION
 
@@ -46,14 +46,14 @@ This does not touch the NNTP article number database.
 =head1 FILES
 
 All public-inbox-specific files are contained within the
-C<$GIT_DIR/public-inbox/> directory.  All files are expected to
+C<$REPO_DIR/public-inbox/> directory.  All files are expected to
 grow in size as more messages are archived, so using compaction
 commands (e.g. L<xapian-compact(1)>) is not recommended unless
 the list is no longer active.
 
 =over
 
-=item $GIT_DIR/public-inbox/msgmap.sqlite3
+=item $REPO_DIR/public-inbox/msgmap.sqlite3
 
 The stable NNTP article number to Message-ID mapping is
 stored in an SQLite3 database.
@@ -70,7 +70,7 @@ messages.
 This file is relatively small, and typically less than 5%
 of the space of the mail stored in a packed git repository.
 
-=item $GIT_DIR/public-inbox/xapian*
+=item $REPO_DIR/public-inbox/xapian*
 
 The database used by L<Search::Xapian>.  This directory name is
 followed by a number indicating the index schema version this
index 594a3d9ca8dff6daf743e880b2cf72f7fb86a350..1debbaacc27881fe9020ce1c3fa26d3055f98025 100755 (executable)
@@ -4,13 +4,13 @@
 # Basic tool to create a Xapian search index for a git repository
 # configured for public-inbox.
 # Usage with libeatmydata <https://www.flamingspork.com/projects/libeatmydata/>
-# highly recommended: eatmydata public-inbox-index GIT_DIR
+# highly recommended: eatmydata public-inbox-index REPO_DIR
 
 use strict;
 use warnings;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use Cwd 'abs_path';
-my $usage = "public-inbox-index GIT_DIR";
+my $usage = "public-inbox-index REPO_DIR";
 use PublicInbox::Config;
 my $config = eval { PublicInbox::Config->new } || eval {
        warn "public-inbox unconfigured for serving, indexing anyways...\n";
@@ -28,8 +28,10 @@ GetOptions(%opts) or die "bad command-line args\n$usage";
 
 my @dirs;
 
-sub resolve_git_dir {
+sub resolve_repo_dir {
        my ($cd) = @_;
+       my $prefix = defined $cd ? $cd : './';
+
        my @cmd = qw(git rev-parse --git-dir);
        my $cmd = join(' ', @cmd);
        my $pid = open my $fh, '-|';
@@ -53,9 +55,9 @@ sub resolve_git_dir {
 }
 
 if (@ARGV) {
-       @dirs = map { resolve_git_dir($_) } @ARGV;
+       @dirs = map { resolve_repo_dir($_) } @ARGV;
 } else {
-       @dirs = (resolve_git_dir());
+       @dirs = (resolve_repo_dir());
 }
 
 sub usage { print STDERR "Usage: $usage\n"; exit 1 }