* [BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit
@ 2008-04-24 18:06 Matthieu Moy
2008-04-29 7:15 ` Eric Wong
0 siblings, 1 reply; 4+ messages in thread
From: Matthieu Moy @ 2008-04-24 18:06 UTC (permalink / raw)
To: git
Hi,
All is in the title ;-).
The command
git svn clone (URL of an empty SVN repo here)
works, creates an empty git repository. I can perform the initial
commit there, but then, "git svn dcommit" says :
Use of uninitialized value in concatenation (.) or string at /home/moy/local/usr/bin/git-svn line 414.
Committing to ...
Unable to determine upstream SVN information from HEAD history
I guess a correct management of the initial commit in git-svn would be
hard to implement, but at least, the error message can be improved.
First step is something like the patch below, and better would be for
"git svn clone" to warn that it won't be able to do much with the
cloned repo.
diff --git a/git-svn.perl b/git-svn.perl
index b864b54..9a70c1e 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -410,10 +410,12 @@ sub cmd_dcommit {
$head ||= 'HEAD';
my @refs;
my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
- print "Committing to $url ...\n";
+ if ($url) {
+ print "Committing to $url ...\n";
+ }
unless ($gs) {
die "Unable to determine upstream SVN information from ",
- "$head history\n";
+ "$head history.\nPerhaps the repository is empty.";
}
my $last_rev;
my ($linear_refs, $parents) = linearize_history($gs, \@refs);
--
Matthieu
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit
2008-04-24 18:06 [BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit Matthieu Moy
@ 2008-04-29 7:15 ` Eric Wong
2008-05-05 8:18 ` [PATCH] Better error message for git svn dcommit on empty repository Matthieu Moy
0 siblings, 1 reply; 4+ messages in thread
From: Eric Wong @ 2008-04-29 7:15 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git, Junio C Hamano
Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
> Hi,
>
> All is in the title ;-).
>
> The command
>
> git svn clone (URL of an empty SVN repo here)
>
> works, creates an empty git repository. I can perform the initial
> commit there, but then, "git svn dcommit" says :
>
> Use of uninitialized value in concatenation (.) or string at /home/moy/local/usr/bin/git-svn line 414.
> Committing to ...
> Unable to determine upstream SVN information from HEAD history
>
> I guess a correct management of the initial commit in git-svn would be
> hard to implement, but at least, the error message can be improved.
> First step is something like the patch below, and better would be for
> "git svn clone" to warn that it won't be able to do much with the
> cloned repo.
Thanks Matthieu,
It shouldn't be *that* hard to implement being able to start an empty
SVN repository from scratch, actually. Of course, there are about
a billion other things people have been asking for in git-svn that I
keep forgetting to implement.
Acked-by: Eric Wong <normalperson@yhbt.net>
> diff --git a/git-svn.perl b/git-svn.perl
> index b864b54..9a70c1e 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -410,10 +410,12 @@ sub cmd_dcommit {
> $head ||= 'HEAD';
> my @refs;
> my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
> - print "Committing to $url ...\n";
> + if ($url) {
> + print "Committing to $url ...\n";
> + }
> unless ($gs) {
> die "Unable to determine upstream SVN information from ",
> - "$head history\n";
> + "$head history.\nPerhaps the repository is empty.";
> }
> my $last_rev;
> my ($linear_refs, $parents) = linearize_history($gs, \@refs);
>
--
Eric Wong
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Better error message for git svn dcommit on empty repository.
2008-04-29 7:15 ` Eric Wong
@ 2008-05-05 8:18 ` Matthieu Moy
2008-05-05 9:13 ` Matthieu Moy
0 siblings, 1 reply; 4+ messages in thread
From: Matthieu Moy @ 2008-05-05 8:18 UTC (permalink / raw)
To: git, gitster; +Cc: Matthieu Moy
Ideally, git-svn should be able to do the initial commit, but since it
isn't, this patch makes it give an accurate error message.
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
git-svn.perl | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index b864b54..9a70c1e 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -410,10 +410,12 @@ sub cmd_dcommit {
$head ||= 'HEAD';
my @refs;
my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
- print "Committing to $url ...\n";
+ if ($url) {
+ print "Committing to $url ...\n";
+ }
unless ($gs) {
die "Unable to determine upstream SVN information from ",
- "$head history\n";
+ "$head history.\nPerhaps the repository is empty.";
}
my $last_rev;
my ($linear_refs, $parents) = linearize_history($gs, \@refs);
--
1.5.5.1.72.gccbb6.dirty
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Better error message for git svn dcommit on empty repository.
2008-05-05 8:18 ` [PATCH] Better error message for git svn dcommit on empty repository Matthieu Moy
@ 2008-05-05 9:13 ` Matthieu Moy
0 siblings, 0 replies; 4+ messages in thread
From: Matthieu Moy @ 2008-05-05 9:13 UTC (permalink / raw)
To: git; +Cc: gitster
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> Ideally, git-svn should be able to do the initial commit, but since it
> isn't, this patch makes it give an accurate error message.
Oops, I just noticed that the patch had already been applied.
Sorry for the noise.
--
Matthieu
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-05 9:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-24 18:06 [BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit Matthieu Moy
2008-04-29 7:15 ` Eric Wong
2008-05-05 8:18 ` [PATCH] Better error message for git svn dcommit on empty repository Matthieu Moy
2008-05-05 9:13 ` Matthieu Moy
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).