{"thread":{"id":"13246","subject":"[BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit","startedAt":"2008-04-24T18:06:36Z","lastAt":"2008-05-05T09:13:47Z","messageCount":4,"participants":["Matthieu Moy","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"75157","messageId":"vpq3apbm8k3.fsf@bauges.imag.fr","threadId":"13246","inReplyTo":null,"subject":"[BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-04-24T18:06:36Z","receivedAt":"2008-04-24T18:06:36Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Hi,\n\nAll is in the title ;-).\n\nThe command\n\n  git svn clone (URL of an empty SVN repo here)\n\nworks, creates an empty git repository. I can perform the initial\ncommit there, but then, \"git svn dcommit\" says :\n\nUse of uninitialized value in concatenation (.) or string at /home/moy/local/usr/bin/git-svn line 414.\nCommitting to  ...\nUnable to determine upstream SVN information from HEAD history\n\nI guess a correct management of the initial commit in git-svn would be\nhard to implement, but at least, the error message can be improved.\nFirst step is something like the patch below, and better would be for\n\"git svn clone\" to warn that it won't be able to do much with the\ncloned repo.\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex b864b54..9a70c1e 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -410,10 +410,12 @@ sub cmd_dcommit {\n        $head ||= 'HEAD';\n        my @refs;\n        my ($url, $rev, $uuid, $gs) = working_head_info($head, \\@refs);\n-       print \"Committing to $url ...\\n\";\n+       if ($url) {\n+               print \"Committing to $url ...\\n\";\n+       }\n        unless ($gs) {\n                die \"Unable to determine upstream SVN information from \",\n-                   \"$head history\\n\";\n+                   \"$head history.\\nPerhaps the repository is empty.\";\n        }\n        my $last_rev;\n        my ($linear_refs, $parents) = linearize_history($gs, \\@refs);\n\n\n-- \nMatthieu\n"},{"id":"75505","messageId":"20080429071552.GH24171@muzzle","threadId":"13246","inReplyTo":"vpq3apbm8k3.fsf@bauges.imag.fr","subject":"Re: [BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-04-29T07:15:52Z","receivedAt":"2008-04-29T07:15:52Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> Hi,\n> \n> All is in the title ;-).\n> \n> The command\n> \n>   git svn clone (URL of an empty SVN repo here)\n> \n> works, creates an empty git repository. I can perform the initial\n> commit there, but then, \"git svn dcommit\" says :\n> \n> Use of uninitialized value in concatenation (.) or string at /home/moy/local/usr/bin/git-svn line 414.\n> Committing to  ...\n> Unable to determine upstream SVN information from HEAD history\n> \n> I guess a correct management of the initial commit in git-svn would be\n> hard to implement, but at least, the error message can be improved.\n> First step is something like the patch below, and better would be for\n> \"git svn clone\" to warn that it won't be able to do much with the\n> cloned repo.\n\nThanks Matthieu,\n\nIt shouldn't be *that* hard to implement being able to start an empty\nSVN repository from scratch, actually.  Of course, there are about\na billion other things people have been asking for in git-svn that I\nkeep forgetting to implement.\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> diff --git a/git-svn.perl b/git-svn.perl\n> index b864b54..9a70c1e 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -410,10 +410,12 @@ sub cmd_dcommit {\n>         $head ||= 'HEAD';\n>         my @refs;\n>         my ($url, $rev, $uuid, $gs) = working_head_info($head, \\@refs);\n> -       print \"Committing to $url ...\\n\";\n> +       if ($url) {\n> +               print \"Committing to $url ...\\n\";\n> +       }\n>         unless ($gs) {\n>                 die \"Unable to determine upstream SVN information from \",\n> -                   \"$head history\\n\";\n> +                   \"$head history.\\nPerhaps the repository is empty.\";\n>         }\n>         my $last_rev;\n>         my ($linear_refs, $parents) = linearize_history($gs, \\@refs);\n> \n-- \nEric Wong\n"},{"id":"76086","messageId":"1209975508-9998-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"13246","inReplyTo":"20080429071552.GH24171@muzzle","subject":"[PATCH] Better error message for git svn dcommit on empty repository.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-05-05T08:18:28Z","receivedAt":"2008-05-05T08:18:28Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Ideally, git-svn should be able to do the initial commit, but since it\nisn't, this patch makes it give an accurate error message.\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n git-svn.perl |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex b864b54..9a70c1e 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -410,10 +410,12 @@ sub cmd_dcommit {\n \t$head ||= 'HEAD';\n \tmy @refs;\n \tmy ($url, $rev, $uuid, $gs) = working_head_info($head, \\@refs);\n-\tprint \"Committing to $url ...\\n\";\n+\tif ($url) {\n+\t\tprint \"Committing to $url ...\\n\";\n+\t}\n \tunless ($gs) {\n \t\tdie \"Unable to determine upstream SVN information from \",\n-\t\t    \"$head history\\n\";\n+\t\t    \"$head history.\\nPerhaps the repository is empty.\";\n \t}\n \tmy $last_rev;\n \tmy ($linear_refs, $parents) = linearize_history($gs, \\@refs);\n-- \n1.5.5.1.72.gccbb6.dirty\n"},{"id":"76104","messageId":"vpqve1txgdw.fsf@bauges.imag.fr","threadId":"13246","inReplyTo":"1209975508-9998-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] Better error message for git svn dcommit on empty repository.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-05-05T09:13:47Z","receivedAt":"2008-05-05T09:13:47Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Ideally, git-svn should be able to do the initial commit, but since it\n> isn't, this patch makes it give an accurate error message.\n\nOops, I just noticed that the patch had already been applied.\n\nSorry for the noise.\n\n-- \nMatthieu\n"}]}