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:

  • ssh-agent doesn't work / save me from typing passphrase for git
  • Why does Git.pm on cygwin complain about 'Out of memory during “large” request?
  • Cygwin ssh key added, but Git permission denied (publickey)
  • git 8728 fork: child -1 - died waiting for longjmp before initial
  • Is it possible to use winmerge to view git diffs from cygwin?
  • How to set default editor when using Git in Cygwin?
  • $ 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?

  • How to get Git on Windows to ignore symbolic links
  • Fail to install MongooseIM In Mac OS
  • How to create a branch from a previous svn-revision using SmartGit?
  • git-svn clone or svn2git unexpectedly stopping
  • How can I perform tasks that require a file name
  • git: Trying to re-create same repo but with some different files
  • 9 Solutions collect form web for “git svn dcommit fails because of assertion error “svn_fspath__is_canonical(child_fspath)” (cygwin)”

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

    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). 🙂

    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
      

    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.

    Downgrading svn is not guaranteed to help: the bug is in serf backend so one has to also make sure to switch to neon backend.

    The bug has been patched in svn upstream: http://thread.gmane.org/gmane.comp.version-control.subversion.devel/145186.

    There’s a workaround submitted to git upstream: http://thread.gmane.org/gmane.comp.version-control.git/237906/focus=239690. As it’s in perl you can apply it locally to your installed version, before any of the above is released and propagates to your environment.

    I have experienced the same on OSX with fink, and solved it by downgrading svn and the perl swig svn bindings to 1.7.11 from 1.8 (and afterwards rebuilding, just in case, git-svn).

    The problem appeared on renames, and happened both on server 1.6.12 and 1.7.9, via dav_svn, on a 1.6 format repository (I am unsure if it happens with svn+ssh as well).

    git-svn is on version 1.8.3.3, which was a requirement in my case (as only git-svn >= 1.7.7 can merge svn-tracked branches, see here).

    I struggled with the accepted answer. I just felt like the accepted answers tells you what to do but not how to do it. I found it much easier to upgrade to the master version of git than downgrade subversion in cygwin. Keep in mind either one will fix the issue. I’ve documented how to build the master version of git here: How do I build and use the latest version of git on cygwin?

    I had the same problem and solved it by reverting to git-svn 1.7.5.1 (svn 1.7.10).

    Not sure but I think the problem is that the repository was cloned with the previous version of svn (1.7.xxx) and for some reason the new version (1.8.0) cannot handle it correctly.

    diff -u  /usr/local/lib/perl5/site_perl/5.16/Git/SVN/Editor.pm.bak  /usr/local/lib/perl5/site_perl/5.16/Git/SVN/Editor.pm    
    --- /usr/local/lib/perl5/site_perl/5.16/Git/SVN/Editor.pm.bak   2014-01-20 15:52:54.000000000 +0100
    +++ /usr/local/lib/perl5/site_perl/5.16/Git/SVN/Editor.pm       2014-01-20 15:55:16.000000000 +0100
    @@ -304,8 +304,9 @@
            my ($self, $m, $deletions) = @_;
            my ($dir, $file) = split_path($m->{file_b});
            my $pbat = $self->ensure_path($dir, $deletions);
    +       my $upa= $self->url_path($m->{file_a});
            my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
    -                               $self->url_path($m->{file_a}), $self->{r});
    +                               $upa, $self->{r});
            print "\tC\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
            $self->chg_file($fbat, $m);
            $self->close_file($fbat,undef,$self->{pool});
    @@ -323,8 +324,9 @@
            my ($self, $m, $deletions) = @_;
            my ($dir, $file) = split_path($m->{file_b});
            my $pbat = $self->ensure_path($dir, $deletions);
    +       my $upa= $self->url_path($m->{file_a});
            my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
    -                               $self->url_path($m->{file_a}), $self->{r});
    +                               $upa, $self->{r});
            print "\tR\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
            $self->apply_autoprops($file, $fbat);
            $self->chg_file($fbat, $m);
    
    Git Baby is a git and github fan, let's start git clone.