Hi I tried to understand how do I merge changes that involve code refactoring, e.g. class rename, from github to our SVN. I had such a need, but I also thought about this issue, now that we accept PRs. So the scenario is this:
- In your git clone, you rename class Foo to Bar - In order to commit that rename to Apache SVN, you need to create a diff and apply it to the svn checkout - If you just run 'patch' or 'svn patch', the commit loses the file history of Foo, as it's just deleted and Bar is added as a new class I asked around and seems that some people were already aware of that, and before applying the patch they replay the moves manually by running 'svn mv'. I tried w/ regular SVN workflow, and turns out if you rename in the SVN checkout, 'svn diff' and then 'svn patch', this doesn't work as well. Only, when you 'svn patch', you get an error that Bar isn't found, so you know something's wrong. But in the git workflow, it just works since Foo is marked as deleted and Bar is marked as Added. As if you ran 'svn diff --show-copies-as-adds". So first, wanted to alert people, especially when we merge PRs (since it's not us doing the rename). Second, has anyone perhaps found a way to overcome that issue? I thought about maybe writing a script to detect that, looking at the patch file, but it seems hard to detect that the deleted Foo is the new Bar. If it's just rename, maybe, but if part of the rename the code changed a lot ... it becomes harder. Shai
