Whenever I execute a commit cycle in svn, I learn diff when writing my comments. I thought it would be very nice to show the actual function in which I made changes when I showed diff.
I checked this page , which said that the -p option would show the C function that the change is in. When I tried using the -p option with some C ++ code, however it usually returns an access specifier (private, public, secure, etc.), which is not very convenient.
I noticed that there is the -F option for diff, which does the same thing as -p, but accepts a user-defined regular expression. I was wondering: is there a simple regular expression to match a C ++ function? This seems to be all that is needed to make it work.
I would spend some time on this, but working in crunch mode, and it seemed like something that many people might find useful, so I decided I posted it here.
EDIT: I'm not looking for something that would be cleverly regx, but something that just finds the closest function definition over the diff scope. The fact that he will not be close to perfection anywhere, and something is bad, everything is fine with me. As long as this works correctly, perhaps 60% of the time will be a significant improvement in IMHO performance.
c ++ linux regex svn diff
J. polfer
source share