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:

git log function evolution

Usage is:

git log -L :<funcname>:<file>


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.