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

From: Eric Wong <[email-masked]>
Date: Thu, 18 Oct 2007 03:33:01 -0700

"Shawn O. Pearce" <[email-masked]> wrote:
> David Kågedal <[email-masked]> wrote:
> > The problem is that the first thing it prints is
> > 
> >   Initialized empty Git repository in .git/
> > 
> > even if actually created a subdirectory and changed into it first. But to the
> > user, it looks like it is creating a .git/ dir in the directory he/she is
> > started git from.
> 
> Eric, ack/nack?

Nack, here's (hopefully) a better patch.

David: agree/disagree?

From 62648d512a27a546707da160c939d665e6da57b4 Mon Sep 17 00:00:00 2001
From: Eric Wong <[email-masked]>
Date: Thu, 18 Oct 2007 03:29:28 -0700
Subject: [PATCH] git-svn: make the output of "git svn clone" less confusing
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Original patch by David Kågedal:
> The problem is that the first thing it prints is
>
>   Initialized empty Git repository in .git/
>
> even if actually created a subdirectory and changed into it
> first. But to the user, it looks like it is creating a .git/ dir
> in the directory he/she is started git from.

Instead of using a relative path, I'm capturing the
output of git-init and adding the absolute path to it.

Signed-off-by: Eric Wong <[email-masked]>
---

 I've actually just noticed that setting GIT_DIR= before running
 git-svn clone is very broken, and I probably won't get a chance
 to fix it for at least 24 hours (if I'm even awake)...

 Johannes/Benoit/all: git-svn submodules will probably have to
 wait till the weekend...

 git-svn.perl |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 777e436..4873bad 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3,6 +3,7 @@
 # License: GPL v2 or later
 use warnings;
 use strict;
+use Cwd qw/getcwd/;
 use vars qw/	$AUTHOR $VERSION
 		$sha1 $sha1_short $_revision
 		$_q $_authors %users/;
@@ -272,7 +273,9 @@ sub do_git_init_db {
 				push @init_db, "--shared";
 			}
 		}
-		command_noisy(@init_db);
+		my $init_out = command(@init_db);
+		$init_out =~ s!(\.git)!getcwd .  "/$1"!e;
+		print $init_out, "\n";
 	}
 	my $set;
 	my $pfx = "svn-remote.$Git::SVN::default_repo_id";
-- 
Eric Wong