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

Re: git svn error "Not a valid object name"

From
Thomas Rast <trast@student.ethz.ch>
Date
Mar 16, 2013, 14:13 UTC
Message-ID
<87y5dnv3es.fsf@pctrast.inf.ethz.ch>
In-Reply-To
<CAJKLP9ZQBXf5ZZY9FccOAL5QU+q1b5SnAfvP9BpARdqvzPuWeg@mail.gmail.com>
[+Cc Eric]
Adam Retter <adam@exist-db.org> writes:
Show 12 quoted lines
> $ git svn init -t tags -b stable -T trunk
> file:///home/ec2-user/svn-rsync/code new-git-repo
> $ cd new-git-repo
> $ git config svn-remote.svn.preserve-empty-dirs true
> $ git config svn-remote.svn.rewriteRoot https://svn.code.sf.net/p/exist/code
> $ git svn fetch -A /home/ec2-user/.svn2git/authors.txt
>
> It all started well and was running away for quite some hours, when
> the following error occurred:
>
> fatal: Not a valid object name
> ls-tree -z  ./webapp/api/: command returned error: 128

The important observation is that the object name is missing; the error is misleading in that it simply tells us that what is *taken* for the object name is invalid.

There appear to be only two uses of ls-tree -z without further options in git-svn, namely:

SVN/Fetcher.pm:165: my ($tree) = (command('ls-tree', '-z', $self->{c}, "./$gpath") SVN/Fetcher.pm:197: ($mode, $blob) = (command('ls-tree', '-z', $self->{c}, "./$gpath

In either one, $self->{c} is empty if they fail in this way. And that seems to come from 'sub new', which says

	if (exists $git_svn->{last_commit}) {
		$self->{c} = $git_svn->{last_commit};
		$self->{empty_symlinks} =
		                  _mark_empty_symlinks($git_svn, $switch_path);
	}

So for some reason new() thinks it's okay to leave $self->{c} uninitialized, but delete_entry() and open_file() expect it to be set.

It does seem that the ls-tree $self->{c} usage in both of those routines is from approximately the beginning of time. See these two, if you compiled your git with log -L:

  git log -L:delete_entry:git-svn.perl a6180325^
  git log -L:open_file:git-svn.perl a6180325^

Unfortunately that's pretty much where my git-svn knowledge ends. Maybe Eric can help?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Adam Retter
Message 7 of 7 in “git svn error "Not a valid object name"”
  1. Adam RetterMar 11, 2013
  2. Eric WongMar 16, 2013
  3. Adam RetterMar 16, 2013
  4. Eric WongMar 16, 2013
  5. Dannes WesselsMar 16, 2013
  6. Adam RetterMar 16, 2013
  7. Thomas RastMar 16, 2013

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.