git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] Make git-svn init accept a target dir
@ 2006-06-28 23:07 Luca Barbato
  2006-06-29  0:28 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Luca Barbato @ 2006-06-28 23:07 UTC (permalink / raw)
  To: git

Since I'm lazy I just hacked a bit git-svn in order to create a target
dir and init it if is passed as second parameter.

git-svn init url://to/the/repo local-repo

will create the local-repo dir if doesn't exist yet and populate it as
expected.

Maybe someone else could find it useful

lu

-- 

Luca Barbato

Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] Make git-svn init accept a target dir
  2006-06-28 23:07 [patch] Make git-svn init accept a target dir Luca Barbato
@ 2006-06-29  0:28 ` Eric Wong
  2006-06-29  0:41   ` Luca Barbato
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2006-06-29  0:28 UTC (permalink / raw)
  To: Luca Barbato; +Cc: git

Luca Barbato <lu_zero@gentoo.org> wrote:
> Since I'm lazy I just hacked a bit git-svn in order to create a target
> dir and init it if is passed as second parameter.
> 
> git-svn init url://to/the/repo local-repo
> 
> will create the local-repo dir if doesn't exist yet and populate it as
> expected.
> 
> Maybe someone else could find it useful

Sounds useful and I'll probably accept it, but I don't see the actual
patch, though...

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] Make git-svn init accept a target dir
  2006-06-29  0:28 ` Eric Wong
@ 2006-06-29  0:41   ` Luca Barbato
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Barbato @ 2006-06-29  0:41 UTC (permalink / raw)
  To: Eric Wong; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

Eric Wong wrote:

> 
> Sounds useful and I'll probably accept it, but I don't see the actual
> patch, though...
> 

ops...

-- 

Luca Barbato

Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero


[-- Attachment #2: git-svn-init.patch --]
[-- Type: text/plain, Size: 1042 bytes --]

--- /usr/bin/git-svn	2006-06-29 00:57:26.000000000 +0200
+++ /usr/bin/git-svn.new	2006-06-28 03:40:11.000000000 +0200
@@ -5,7 +5,7 @@
 use strict;
 use vars qw/	$AUTHOR $VERSION
 		$SVN_URL $SVN_INFO $SVN_WC $SVN_UUID
-		$GIT_SVN_INDEX $GIT_SVN
+		$GIT_SVN_INDEX $GIT_SVN $REPO_PATH
 		$GIT_DIR $REV_DIR/;
 $AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
 $VERSION = '1.1.0-pre';
@@ -98,6 +98,7 @@
 $GIT_SVN ||= $ENV{GIT_SVN_ID} || 'git-svn';
 $GIT_SVN_INDEX = "$GIT_DIR/$GIT_SVN/index";
 $SVN_URL = undef;
+$REPO_PATH = undef;
 $REV_DIR = "$GIT_DIR/$GIT_SVN/revs";
 $SVN_WC = "$GIT_DIR/$GIT_SVN/tree";
 
@@ -227,6 +228,16 @@
 sub init {
 	$SVN_URL = shift or die "SVN repository location required " .
 				"as a command-line argument\n";
+        $REPO_PATH = shift;
+        
+        if ($REPO_PATH) {
+            unless (-d $REPO_PATH) {
+                mkpath([$REPO_PATH]);
+            }
+            $GIT_DIR=$REPO_PATH . "/.git";
+            $ENV{GIT_DIR}=$GIT_DIR;
+        }
+
 	unless (-d $GIT_DIR) {
 		sys('git-init-db');
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-06-29  0:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-28 23:07 [patch] Make git-svn init accept a target dir Luca Barbato
2006-06-29  0:28 ` Eric Wong
2006-06-29  0:41   ` Luca Barbato

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 NNTP newsgroup(s).