GithubHelp home page GithubHelp logo

Comments (3)

charleso avatar charleso commented on June 17, 2024

Git doesn't track renames. Period. Instead you can ask Git to calculate renames based on the content changes.

Have you tried running 'git log -M --name-status', 'git log --follow $FILE' or 'git diff -M' to force git to tell you about renames?

from git-cc.

nesqi avatar nesqi commented on June 17, 2024

I see that I was incorrect in stating that all moved files will loose their history. In some cases it will actually work.

It's correct that git only tracks changes, however this is only done if the add and remove is in the same git commit. A file movement in ClearCase constitutes of 2 directory changes.

  1. the file is unlinked from the source directory
  2. the file is added to the new directory.

If for some reason gitcc does not commit these changes in the same git-commit the history for the file will be lost. It is not unlikely that the commits will be split between different commits. Even though the commit message is the same for both source and dest dir commits in clearcase (which it might not be) there must be NO OTHER commits in between.

So if one user updates a file and another user changes the name of a file (in clearcase), history might be lost for the file in the conversion.

from git-cc.

charleso avatar charleso commented on June 17, 2024

Ahh, yes. Good point. Yes, that's a much harder problem to solve - "detecting" property atomic commits (which of course don't actually exist in Clearcase). My current logic, as you've discovered, is naive in the extreme.

If you're only doing this as a once off import, my personal opinion is to use the power of 'git filter-branch' after you have all the history. Doing these sorts of operations in Git is trivial and extremely quick, assuming you can manually detect/mark these sorts of cases (see below).

Feel free to create another issue for this if you like, although sadly I personally won't be working on it due to reasons stated earlier (I don't use Clearcase any more).

PS You can run "git log -C -C -C" etc to detect renames across commits. It's slow downs as you add more C's of course...

from git-cc.

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.