3

When attemping to git svn dcommit to a repository that has spaces in it's name, I get the following error:

Committing to http://svn.kuluvalley.com/Meet the Expert/trunk ...
http://svn.kuluvalley.com/Meet the Expert/trunk
Filesystem has no item: '/!svn/bc/7397/Meet' path not found at /usr/libexec/git-core/git svn line 592

It looks like git svn doesn't support directories with spaces in them.

Karl
  • 1,615
  • 1
  • 14
  • 20
  • Possible duplicate of [git-svn clone fails "fatal: Not a valid object name"](http://stackoverflow.com/questions/11365317/git-svn-clone-fails-fatal-not-a-valid-object-name) – kenorb Nov 16 '15 at 15:44

2 Answers2

7

I was able to work around the problem of git svn not working for repositories with spaces in them by patching git-svn.

I updated the url_path function to:

sub url_path { 
  my ($self, $path) = @_; 

  my $url = $self->{url} . '/' . $self->repo_path($path); 
  if ($self->{url} =~ m#^https?://#) { 
    $url =~ s!([^~a-zA-Z0-9_./-])!uc sprintf("%%%02x",ord($1))!eg; 
    $url =~ s!^(https?)%3A//!$1://!; 
  } 
  $url 
} 

For windows (x64) users, this function can be found in Editor.pm file, which is located in

{Git installation folder}\mingw64\share\perl5\site_perl\Git\SVN\

This ensures that the spaces in the url are encoded correctly.

It seems to work for me, but hasn't been tested thoroughly.

Athafoud
  • 2,898
  • 3
  • 40
  • 58
Karl
  • 1,615
  • 1
  • 14
  • 20
-1

I believe the problem with spaces is fixed in Git >= 1.8.0 (See: #786942).

So you should consider to upgrade it.

See GitHub Home page: https://github.com/git/git

kenorb
  • 155,785
  • 88
  • 678
  • 743