Recent versions of
git log learned a special form of the
Trace the evolution of the line range given by
"<start>,<end>"(or the function name regex
<funcname>) within the
<file>. You may not give any pathspec limiters. This is currently limited to a walk starting from a single revision, i.e., you may only give zero or one positive revision arguments. You can specify this option more than once.
“:<funcname>”is given in place of
<end>, it is a regular expression that denotes the range from the first funcname line that matches
<funcname>, up to the next funcname line.
“:<funcname>”searches from the end of the previous
-Lrange, if any, otherwise from the start of file.
“^:<funcname>”searches from the start of file.
In other words: if you ask Git to
git log -L :myfunction:path/to/myfile.c, it will now happily print the change history of that function.