7

I'm trying to do git svn dcommit, however, one directory continues to fail on me and therefore stops my commit and continue to get this error:

Filesystem has no item: File not found: transaction '43999-6', path '/path/to/folder' at /usr/local/git/libexec/git-core/git-svn line 572

I tried adding the folder back in but i continue to get that error. can I remove a commit from the tree to bypass this? Not sure what else to do here.

edit
some of the following don't fully answer my question, but they seem to be in the right direction:

The last issue seems to be what I wanted, but with the size of my repo (last time, took me around a whole work day to checkout the entire thing), and the little amount of work I would have lost by just doing a hard reset (which ultimately seemed to do the trick), I went for the hard reset option.

Community
  • 1
  • 1
hellatan
  • 3,171
  • 1
  • 24
  • 36

5 Answers5

1

I believe the problem should be fixed in Git >= 1.8.0

You should consider to upgrade it.

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

kenorb
  • 118,428
  • 63
  • 588
  • 624
  • Would you have a defect id for that issue maybe ? – Patrice M. Mar 18 '15 at 00:47
  • @PatriceM. I couldn't find it, because git doesn't use any bug tracker, just mailing list. However as far as I remember when installing git 1.8.x, to problem with space handling in file names was solved. – kenorb Mar 18 '15 at 11:33
  • For reference, I'm currently experiencing this issue(Spaces in an SVN folder) with Git 2.4.1 and SVN 1.8.13 – Azuvector Jul 06 '15 at 20:24
1

I don't think git-svn actually supports renaming files. I get this error every time I try to rename something. I always end up having to rename it with svn and then rebase with git-svn.

Update

This is likely due to the fact that git-svn doesn't play nicely with spaces in URLs. I often have to rename project paths in order to get them to work with git-svn. Of course, this isn't an acceptable solution for projects that actually have other people working on them. For those I simply have to resort to using svn to move files. It's a huge hassle.

Jim Mitchener
  • 8,435
  • 7
  • 40
  • 55
  • so you're saying you can't even rename it in `git` and then do a `git svn dcommit` for svn to see your changes? – hellatan Jun 10 '11 at 15:49
  • I think it's supposed to but it's not working for me. I get file not found errors when I try to dcommit. – Jim Mitchener Jun 10 '11 at 19:35
  • hmmm...i would imagine it would be fine. I'll have to look at that myself and see what happens when i try. – hellatan Jun 10 '11 at 20:54
1

svn reset --hard didn't work for me

the reason of this is that when doing a dcommit to svn, it seems like the commit that deleted the file appears to be done in both git and svn at the same time but the link is lost.

The solution that worked for me was to reset master to the commit before the problem, then merge all sucessive commit back to master (except the faulty one), then redo the file deletion. there may be a more elegant solution...

side note: git svn DOES svn rename/move files correctly. It (either tortoisegit+mysgit or jgit/egit) does it automagically all the time ;)

cogito
  • 11
  • 2
1

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 
} 

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

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

Karl
  • 1,505
  • 1
  • 12
  • 20
0

I know this is an old question but I had this exact issue recently and wanted to share how I fixed the problem. Admittedly this is not a nice solution but it allowed me to complete my commit. I did the following:

  1. Added the folder/file under complaint back into svn using svn.
  2. Committed my original code from git to svn (git svn dcommit --rmdir)
  3. Deleted the folder/file in git and committed this to svn.

This meant I had an extra 2 small commits, one to add and then another to remove the offending folder/file but after this everything worked as expected again. I know this isn't a nice solution and it doesn't address the root of the problem but at least it allowed me to commit my code. Hopefully this can help someone else in this situation needing a quick fix.

Stuart
  • 2,786
  • 4
  • 20
  • 28