3 ms·
That's in some sense already native git functionality. (Though I recognize that the entire askgit here is essentially a layer on top of some existing functiona
by JulianWasTaken 6y ago
That's in some sense already native git functionality.
(Though I recognize that the entire askgit here is essentially a layer on top of some existing functionality).
But changes to a specific function is a particularly underused feature in git.
You do `git log -L :nameOfFunction:fileItLives.ext` and git will show you changes to the function over time.
Of course that syntax is completely arcane (which contributes to its underuse), but e.g. for Python I just wrote a trivial thing to let me instead write `git pylog foo.bar.baz` and it translates to the right syntax above (that lives here: https://github.com/Julian/dotfiles/blob/76bd63f6c9a2c650c18508e75c434c2a66dd9eb7/bin/git-pylog https://github.com/Julian/dotfiles/blob/76bd63f6c9a2c650c185...)