title: Getting svn diff to show C++ function during commit
body: <p>Whenever I do a commit cycle in svn, I examine the diff when writing my comments.  I thought it would be really nice to show the actual function that I made the modifications in when showing the diff.  </p>
  
  <p>I checked out <a href="http://www.xenomai.org/index.php/Teaching_-p_to_svn_diff" rel="nofollow noreferrer">this page</a>, which mentioned that the -p option will show the C function that the change is in.  When I tried using the -p option with some C++ code, however, it usually returns the access specifier (private, public, protected, etc), which isn't terribly handy.</p>
  
  <p>I did notice that there is a -F option for diff that does the same as -p, but takes a user-specified regex.  <strong>I was wondering: is there a simple regex to match a C++ function?</strong> It seems like that would be all that is necessary to get this to work.</p>
  
  <p>I'd spend some time looking at this myself, but work is in crunch-mode and this seemed like something that a lot of people would find useful, so I figured I'd post it here.</p>
  
  <p>EDIT:  I'm not looking for something that's a slam-dunk catch-all regex, but something that would simply find the nearest function definition above the area diff would show.  The fact that it would be nowhere near perfect, and somewhat buggy is okay with me.  Just as long as it works right maybe like 60% of the time would be a significant productivity improvement IMHO.</p>