Git definition of renaming when changing name and file name in one commit

What is the best way to handle class renaming (e.g. done with Resharper) with Git?

That is, if both the class name and the file name are changed together with it and are committed without further changes.

It seems that the Git method handles renaming through a percentage change in the heuristic - it's a bit and a miss. For large classes, it will be recognized as a renaming, but for small classes a percentage threshold is reached, so that it will be considered as deletion and addition.

+7
source share
2 answers

, Git " X Y". X , Y ( X ). :

Revision | Files
---------+----------------------------------
HEAD^    | a.cpp    x.cpp             z.cpp
HEAD     | a.cpp              y.cpp   z.cpp

. x.cpp y.cpp. , , - .

Git ( , Git), , , y.cpp - HEAD. , , . , , x.cpp ( ). , x.cpp y.cpp.

, Git , , ( ). . , Git , , Git , .

, resharper - . Git . , , . , git log, , --find-copies --find-copies-harder.

+8

, , , git.

, , . , (--find-copies --find-copies-harder --find-copies-harder, , ).

0

All Articles