2 ms·
No. The simplest example I can think of is: Revision 1: x Revision 2: xx Which x was added in revision 2? In real life, you get things like replacements
by Someone 14y ago
No. The simplest example I can think of is:
Revision 1: x
Revision 2: xx
Which x was added in revision 2?
In real life, you get things like replacements of a statement by an if-else block with statements similar to, but not identical to, the original statement in each branch. Are there still parts of the original statement there? If so, in which branch(es)?
Also, suppose I add code in version 6, you remove it in version 14 and someone else resurrects it in version 23. What commit contributed that code? How can you know whether that someone else resurrected the code, rather than write a new copy?
Finally, what is 'contribute'? Does a commit that 'only' moves lines around in online help contribute to a file? What does it contribute? How do you show that contribution in a diff? What if the move also necessitated some minor changes like adding punctuation?