{"thread":{"id":"33034","subject":"git blame -M seems not to work as expected","startedAt":"2013-02-27T15:45:22Z","lastAt":"2013-02-27T15:45:22Z","messageCount":1,"participants":["Sokolov, Konstantin (ext)"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"210402","messageId":"6AD84402EDEFAA4D833C4235C5F5CC8D31DA5830@DEFTHW99EF4MSX.ww902.siemens.net","threadId":"33034","inReplyTo":null,"subject":"git blame -M seems not to work as expected","fromName":"Sokolov, Konstantin (ext)","fromEmail":"konstantin.sokolov.ext@siemens.com","sentAt":"2013-02-27T15:45:22Z","receivedAt":"2013-02-27T15:45:22Z","isPatch":false,"sender":{"key":"konstantin.sokolov.ext@siemens.com","avatar":null},"body":"Hi Folks!\n\nI've posed this question already on stackoverflow and on Google Groups - without any (satisfying) answer. So maybe you can help me to understand the behavior of git blame -M.\n\nFirst I commit the following file(file.cpp):\n\nvoid func1(){return;}[CR][LF]\nint func2(){return 23;}[CR][LF]    \n\nThen I modify it by moving what was in the first line and adding something new instead:\n\nfloat newFunc(){return 23.0;}[CR][LF]\nint func2(){return 23;}[CR][LF]\n[CR][LF]\n[CR][LF]\nvoid func1(){return;}[CR][LF]\n \nThe log now looks as follows:\n\n>git log --oneline -2\n18c670f modified file.cpp\n92b4186 added file.cpp\n \nNow I run blame:\n\ngit blame -s -w -M file.cpp\n18c670fa 1) float newFunc(){return 23.0;}\n92b4186d 2) int func2(){return 23;}\n18c670fa 3)\n18c670fa 4)\n18c670fa 5) void func1(){return;}\n \nI wonder why the line containing func1() isn't recognized as moved. I've tried to reduce the number of required characters (i.e. -M4 etc.). Furthermore spaces should not matter because of the -w option.\n\nOn the other hand, when I move float newFunc(){return 23.0;} from line 1 to line 6 (which was empty before) in the subsequent commit, git blame -M correctly recognizes that it originates from commit 18c670fa even though it firstly appeared in line 6 only in the current commit. \n\nSo what's the reason for this seemingly inconsequent behavior? As far as I understand the documentation, both movements should be recognized. It's very important for us to correctly understand the behavior of git blame -M since we are about to add some code analysis logic on top of git blame. \n\nThanks in advance\nKonstantin\n"}]}