Is there a version control system that can show changes to a specific method or function?

Posted by chesles on Programmers See other posts from Programmers or by chesles
Published on 2011-11-18T23:44:02Z Indexed on 2011/11/19 2:07 UTC
Read the original article Hit count: 183

Filed under:
|

Sometimes it would be nice to be able to say something like:

(git|svn|hg|etc) diff Foo.c:main
(git|svn|hg|etc) log log Foo.c:main

to see the changes made to a specific function within a source file since the last commit, or the complete history of changes. My question is two-fold:

  1. Does something exist that does this?
  2. Would such a tool be practical? It would have to do some simple parsing of the code at each revision in order to compare different versions of the function; would the overhead be too much for it to be efficient?

© Programmers or respective owner

Related posts about version-control

Related posts about tools