Skip to content

Commit

Permalink
contrib/git-svn: add --id/-i=$GIT_SVN_ID command-line switch
Browse files Browse the repository at this point in the history
I ended up using GIT_SVN_ID far more than I ever thought I
would.  Typing less is good.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Mar 3, 2006
1 parent 1ca72ae commit 6f0783c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions contrib/git-svn/git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
$AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
$VERSION = '0.10.0';
$GIT_DIR = $ENV{GIT_DIR} || "$ENV{PWD}/.git";
$GIT_SVN = $ENV{GIT_SVN_ID} || 'git-svn';
$GIT_SVN_INDEX = "$GIT_DIR/$GIT_SVN/index";
$ENV{GIT_DIR} ||= $GIT_DIR;
$SVN_URL = undef;
$REV_DIR = "$GIT_DIR/$GIT_SVN/revs";
$SVN_WC = "$GIT_DIR/$GIT_SVN/tree";

# make sure the svn binary gives consistent output between locales and TZs:
$ENV{TZ} = 'UTC';
$ENV{LC_ALL} = 'C';
Expand Down Expand Up @@ -78,7 +71,17 @@
my %opts;
%opts = %{$cmd{$cmd}->[2]} if (defined $cmd);

GetOptions(%opts, 'help|H|h' => \$_help, 'version|V' => \$_version ) or exit 1;
GetOptions(%opts, 'help|H|h' => \$_help,
'version|V' => \$_version,
'id|i=s' => \$GIT_SVN) or exit 1;

$GIT_SVN ||= $ENV{GIT_SVN_ID} || 'git-svn';
$GIT_SVN_INDEX = "$GIT_DIR/$GIT_SVN/index";
$ENV{GIT_DIR} ||= $GIT_DIR;
$SVN_URL = undef;
$REV_DIR = "$GIT_DIR/$GIT_SVN/revs";
$SVN_WC = "$GIT_DIR/$GIT_SVN/tree";

usage(0) if $_help;
version() if $_version;
usage(1) unless defined $cmd;
Expand Down

0 comments on commit 6f0783c

Please sign in to comment.