So I found the question about how to view the change history of a file, but the change history of this particular file is huge and I\'m really only interested in the changes
Recent versions of git log learned a special form of the -L
parameter:
-L :
: Trace the evolution of the line range given by
"
(or the function name regex, " ) within the
. 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.
...
If“:
is given in place of” and
, it is a regular expression that denotes the range from the first funcname line that matches
, up to the next funcname line.
“:
searches from the end of the previous” -L
range, if any, otherwise from the start of file.“^:
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.