Giter Site home page Giter Site logo

Comments (10)

marklarr avatar marklarr commented on July 21, 2024

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.

from synx.

cnstoll avatar cnstoll commented on July 21, 2024

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.

from synx.

marklarr avatar marklarr commented on July 21, 2024

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.

from synx.

cnstoll avatar cnstoll commented on July 21, 2024

Awesome :)

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

from synx.

tkrajacic avatar tkrajacic commented on July 21, 2024

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.

from synx.

cnstoll avatar cnstoll commented on July 21, 2024

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

from synx.

marklarr avatar marklarr commented on July 21, 2024

@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.

from synx.

fabiopelosin avatar fabiopelosin commented on July 21, 2024

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!

from synx.

marklarr avatar marklarr commented on July 21, 2024

Thanks @irrationalfab :)

Are we comfortable closing this issue?

from synx.

haojianzong avatar haojianzong commented on July 21, 2024

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

from synx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.