Search code examples
git-svn

How to properly handle a discontinuity in git-svn


I am in a situation where (say) commit 666 is dodgy, i.e

git svn clone [REPO] -r665 #works
git svn clone [REPO] -r666 #Malformed XML
git svn clone [REPO] -r667 #works

but even weirder

git svn clone [REPO] -r665
cd [REPO_NAME]
git svn fetch -r667 #Malformed XML
git svn fetch -r668 #Malformed XML
git svn fetch -r669 #Malformed XML
...

(this also happens with analogous commands in SVN)

currently, the only way I know around this is either

  • forgo having any history before r666
  • using 2 svn repos pointing to the same remote and hacking around with rebase/cherry pick

Is there a more proper way to do this?


Solution

  • I remember hacking git cherry-pick to fix this

    I did something along the lines of (disclaimer: untested):

    git-svn init -R one -s [SVN-URL]
    git-svn init -R two -s [SVN-URL] -r667
    git checkout [svn-remote-one-trunk]
    git checkout -b git-master
    git cherry-pick [first commit SHA of svn-remote-two-trunk]
    #Fix conflicts
    git cherry-pick [svn-remote-two-trunk]
    

    had to do this several times and git-master is incompatible with the svn remotes so it would either have to be discarded or any svn work would have to go on the svn branches and I had to incorporate cherry picking into my workflow until everyone got migrated to git.