On , I learnt ...
You can use Git log to view the evolution of a function
Modern versions of git log
provide a -L
option which lets you trace the
evolution of a line range or function:
Usage is:
git log -L :<funcname>:<file>
where:
<funcname>
is a regular expression to match the function name.<file>
is the path to the file where the function lives.
Example usage:
git log -L :get_locale:octoenergy/utils/workingdays.py
Depending on what language you’re working with, you may need to adjust you local
~/.gitattributes
file to ensure Git can determine the patch hunk headers.
More in the official git docs.