Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Git Move/SVN Move, etc. #3

Closed
cnstoll opened this issue May 29, 2014 · 10 comments
Closed

Support for Git Move/SVN Move, etc. #3

cnstoll opened this issue May 29, 2014 · 10 comments

Comments

@cnstoll
Copy link

cnstoll commented May 29, 2014

First of all, grats on a great first release!

I'm sure you saw this coming, but support for various version control mv operations would be hugely helpful. That would allow this to be a common operation in a mature source control environment. As it is, I would consider this more of a "lets just fix this darn project" operation that I would run once initially rather than an ongoing maintenance tool.

@marklarr
Copy link
Member

Does running git add -A afterwards fix the issue? It's difficult to use git mv, etc, instead because of the way synx builds out the reorganized project.

@cnstoll
Copy link
Author

cnstoll commented May 29, 2014

Sort of. Adding the files to the repo doesn't end up being much of a pain point. The pain point is preserving file integrity so that history stays the same.

Having spent a lot of time doing these sorts of things in the past, the real pain is really in the git/svn/perforce moves. You end up having to do those manually, which is super tedious and time consuming. Being able to automate that with a tool would be hugely valuable.

@marklarr
Copy link
Member

Ah! Yeah, that makes sense. The way synx works right now is that it builds out your new project structure in a temporary directory, and then replaces your current project with it once it's done. This makes the whole process a lot cleaner than trying to do it in-place.

Obviously, this makes doing the git move stuff hard, but I agree that it'd be nice.

@cnstoll
Copy link
Author

cnstoll commented May 29, 2014

Awesome :)

I agree this is no easy task, but it would definitely be a huge value add for the tool!

@tkrajacic
Copy link

AFAIK git mv is no different then removing a file, moving it and adding it at a new place (that is, if there are not simultaneously severe content changes in it).

Can't find a better source unfortunately to back this up than this link:
http://stackoverflow.com/questions/433111/how-to-make-git-mark-a-deleted-and-a-new-file-as-a-file-move

So, if you commit all changes before doing the cleanup (which would make sense anyway) then you should be fine.

@cnstoll
Copy link
Author

cnstoll commented May 29, 2014

Interesting, that does appear to work as you describe. Git detects it as a rename.

@marklarr
Copy link
Member

@mickeyreiss described to me one situation where it'd be different.

Let's say you have files at path A and B. If you swap their paths, it will actually think that you changed the contents of these files, rather than moved them around. Sort of an edge case, though, and I don't really see it happening outside of cases where you've just done a major bulk sync.

@fabiopelosin
Copy link

As far as I know GIT doesn't store any metadata regarding wether a file a has been renamed. It is inferred from the commit.

@marklarr thanks for the awesome work, this has been in my TODO list for ages!

@marklarr
Copy link
Member

Thanks @irrationalfab :)

Are we comfortable closing this issue?

@haojianzong
Copy link

I found synx may work well for git, but it does not work for svn. After moving files, all svn histories will be lost.

Therefore I wrote a script to bridge "svn mv" so that it is possible to preserve svn histories.

For those using SVN, you may want to take a look at this script: https://gist.github.com/haojianzong/5ab0ce86725f3785154d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants