Hi Folks!

When using git blame -M in order to detect code movements inside one file, 
I get results which I cannot explain to myself.

First I commit the following file(file.cpp):

void func1(){return;}[CR][LF]
int func2(){return 23;}[CR][LF]    

Then I modify it by moving what was in the first line and adding something 
new instead:

float newFunc(){return 23.0;}[CR][LF]
int func2(){return 23;}[CR][LF]
void func1(){return;}[CR][LF]

The log now looks as follows:

>git log --oneline -2
18c670f modified file.cpp
92b4186 added file.cpp

Now I run blame:

git blame -s -w -M file.cpp
18c670fa 1) float newFunc(){return 23.0;}
92b4186d 2) int func2(){return 23;}
18c670fa 3)
18c670fa 4)
18c670fa 5) void func1(){return;}

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

Ot 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 -Mcorrectly 
recognizes that it originates from commit 18c670fa even though it 
first appeared in line 6 only in the current commit. 

So what's the reason for this seemingly inconsequent behavior? Does anybody 
have an idea?

Thanks in advance

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to