I have two branches with the structure:
---(commit 1) ----- (commit 2, refactoring) ----(CONFLICT)
\ /
\ /
-----(commit 3, modifying) --------/
In the commit 1 I have a file text.txt:
Part 1:
line 1
line 2
line 3
Part 2:
line 4
line 5
line 6
In commit 2 I extract "part 2" of the text.txt into the part2.txt, so I get:
text.txt:Part 1: line 1 line 2 line 3part2.txt:Part 2: line 4 line 5 line 6
In commit 3 I slightly modify both parts of text.txt:
Part 1:
line 1
line 2a
line 3
Part 2:
line 4
line 5b
line 6
Merging two branches I expect git to be smart enough and put line 2a into text.txt and line 5b into part2.txt. Unfortunately this doesn't happen.
My expectations are based on the fact, that git gui blame part2.txt detects origin of the lines correctly showing text.txt.
My questions are:
- Why doesn't it work out of the box?
- Is there some workaround known?