git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Better error message for git svn dcommit on empty repository.

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
May 5, 2008, 08:18 UTC
Message-ID
<1209975508-9998-1-git-send-email-Matthieu.Moy@imag.fr>
In-Reply-To
<20080429071552.GH24171@muzzle>

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
Previous: Eric WongNext: Matthieu Moy
Message 3 of 4 in “[BUG] git svn accepts to clone an empty SVN repo, but then fails to dcommit”
  1. Matthieu MoyApr 24, 2008
  2. Eric WongApr 29, 2008
  3. Better error message for git svn dcommit on empty repository.Matthieu Moy, May 5, 2008
  4. Matthieu MoyMay 5, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.