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.

2
  • Are you accessing your svn repo via https? Commented Sep 9, 2011 at 23:26
  • no, this was set up on just http. Commented Sep 21, 2011 at 15:12

5 Answers 5

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 ;)

Sign up to request clarification or add additional context in comments.

Comments

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.

3 Comments

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?
I think it's supposed to but it's not working for me. I get file not found errors when I try to dcommit.
hmmm...i would imagine it would be fine. I'll have to look at that myself and see what happens when i try.
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.

Comments

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

3 Comments

Would you have a defect id for that issue maybe ?
@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.
For reference, I'm currently experiencing this issue(Spaces in an SVN folder) with Git 2.4.1 and SVN 1.8.13
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.