public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag•fr>
To: git <git@vger•kernel.org>
Subject: [BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit
Date: Thu, 24 Apr 2008 20:06:36 +0200	[thread overview]
Message-ID: <vpq3apbm8k3.fsf@bauges.imag.fr> (raw)

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

             reply	other threads:[~2008-04-24 18:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24 18:06 Matthieu Moy [this message]
2008-04-29  7:15 ` [BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpq3apbm8k3.fsf@bauges.imag.fr \
    --to=matthieu.moy@imag$(echo .)fr \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox