Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Make the output of "git svn clone" less confusing.

From: David Kågedal <hidden>
Date: 2016-06-15 22:43:41

Eric Wong [off-list ref] writes:
quoted
diff --git a/git-svn.perl b/git-svn.perl
index 777e436..d4450ca 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -286,6 +286,7 @@ sub do_git_init_db {
 
 sub init_subdir {
 	my $repo_path = shift or return;
+	print "Creating directory $repo_path\n";
 	mkpath([$repo_path]) unless -d $repo_path;
 	chdir $repo_path or die "Couldn't chdir to $repo_path: $!\n";
Since mkpath() isn't guaranteed to get called, maybe putting a

	print "Entering directory $repo_path\n"

right before the chdir is better.
You're probably right.
The other option would be to alter git-init to print the absolute path
of the repository being initialized...
Absolute paths don't sound like a great idea to me. Ideally, I'd like
to see the path I gave it, or something relative to the working
directory. That is, *my* working directory, and not some internal one
because one of the tools did a chdir.

Can't we make init_subdir in git-svn not chdir, instead?  Like this,
highly untested?
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -288,8 +288,7 @@ sub init_subdir {
 	my $repo_path = shift or return;
 	print "Creating directory $repo_path\n";
 	mkpath([$repo_path]) unless -d $repo_path;
-	chdir $repo_path or die "Couldn't chdir to $repo_path: $!\n";
-	$ENV{GIT_DIR} = '.git';
+	$ENV{GIT_DIR} = '$repo_path/.git';
 }
 
 sub cmd_clone {

-- 
David Kågedal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help