Modern versions of
git log provide a
-L option which lets you trace the
evolution of a line range or function:
git log -L :<funcname>:<file>
<funcname>is a regular expression to match the function name.
<file>is the path to the file where the function lives.
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.