git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 8/9] contrib/git-svn: add --id/-i=$GIT_SVN_ID command-line switch

From
EWEric Wong <normalperson@yhbt.net>
Date
Mar 3, 2006, 09:20 UTC
Message-ID
<11413776092524-git-send-email-normalperson@yhbt.net>
In-Reply-To
<11413776092493-git-send-email-normalperson@yhbt.net>

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>
---
 contrib/git-svn/git-svn.perl |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
1d3dc63f7ed276863c71f9a212471658f359ef75
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index 041791b..db199a3 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -10,13 +10,6 @@ use vars qw/	$AUTHOR $VERSION
 $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';
@@ -78,7 +71,17 @@ foreach (keys %cmd) {
 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;
-- 
1.2.3.g4676
Previous: Eric WongNext: Eric Wong
Message 2 of 3 in “contrib/git-svn: avoid re-reading the repository uuid, it never changes”
  1. 7/9 contrib/git-svn: avoid re-reading the repository uuid, it never changesEric Wong, Mar 3, 2006
  2. 8/9 contrib/git-svn: add --id/-i=$GIT_SVN_ID command-line switchEric Wong, Mar 3, 2006
  3. 9/9 contrib/git-svn: better documenting of CLI switchesEric Wong, Mar 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.