Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git svn dcommit fails because of assertion error "svn_fspath__is_canonical(child_fspath)" (cygwin)

I hope anybody can help me.

When I try to push my local git branch to the svn server this will always result into this error:

$ git svn dcommit
Committing to http://.../Dev_Stream/01_workspace ...
    C      path/to/file/AbstractSystemThread.java => other/path/to/file/Thread/AbstractThread.java
assertion "svn_fspath__is_canonical(child_fspath)" failed: file "/usr/src/subversion/subversion-1.8.0-1/src/subversion-1.8.0/subversion/libsvn_subr/dirent_uri.c", line 2502, function: svn_fspath__skip_ancestor

Preconditions:

  • clean local git repository (no staged or unstaged changes)
  • called git svn rebase before

Cygwin installation contains these packages:

  • git, git-svn 1.7.9-1
  • subversion, subversion-perl 1.8.0-1

When searching for this problem in the internet, I found several errors like this where a path could not be canonicalized. But I did not find a solution for exactly this problem.

Has anybody an idea how to solve it? Is any information missing?

like image 616
gofabian Avatar asked Jul 17 '13 07:07

gofabian


4 Answers

If you cannot downgrade to SVN 1.7.X, another option is doing the Git-SVN commit this way:

git svn dcommit -C1 -l1

This basically turns off Git rename detection (so it is a workaround, not a fix). You will lose rename track information (a rename will be committed as a delete followed by a new file, like SVN 1.4). But the commit will work.

Edit In spite of some comments here, I believe this will work with the current Git version on the Cygwin repository (1.7.9.1). If some day that changes, I'll update my answer accordingly.

In fact, let's hope the situation improves to the point that we won't need any fix or workaround, and Git-SVN just works (as it used to). :-)

like image 160
rsenna Avatar answered Nov 13 '22 13:11

rsenna


I also had this problem (git version 1.8.3) and solved it by downgrading subversion to 1.7.9 (from 1.8.0).

like image 20
Peter Dinges Avatar answered Nov 13 '22 11:11

Peter Dinges


An easy way to install patched version of git-svn from github:

  1. Find the buggy script:

    find /usr -name Editor.pm
    
  2. Replace it with patched version:

    cd /usr/lib/perl5/vendor_perl/5.18.1/Git/SVN
    mv Editor.pm Editor.pm.bak
    wget https://raw.github.com/git/git/2394e94e831991348688831a384b088a424c7ace/perl/Git/SVN/Editor.pm
    
like image 4
alexanderlukanin13 Avatar answered Nov 13 '22 11:11

alexanderlukanin13


I've managed how to solve this problem w/o downgrading svn. Error msg was like this:

git svn dcommit
Committing to http://...
        C       File1.hpp => File2.hpp

ERROR from SVN:
RA layer request failed: PUT request on '...File2.hpp' failed: 409 Conflict...

then I've rebased just before this commit, removed File1.hpp, made new commit and in next one just added File2.hpp like a new one. After this git svn dcommit wasn't complaining anymore.

like image 3
ptw Avatar answered Nov 13 '22 11:11

ptw