Watching https://www.youtube.com/watch?v=aolI_Rz0ZqY and `git log -L :mymethod:my/file.rb` is blowing my mind 🤯

Shows a log of only the changes in my/file.rb related to mymethod.

So You Think You Know Git - FOSDEM 2024

YouTube
From the docs, it seems like "related to mymethod" means that Git has patterns for detecting methods/functions in various languages (https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header) and it will regexp-match the provided method name to those up until the start of the next method (https://git-scm.com/docs/git-log#Documentation/git-log.txt--Lfuncnamefile).
Git - gitattributes Documentation

Even more nuanced – it's more like "related to the lines currently comprising mymethod", so this history will typically work through method renames.

@henrik I have a couple of those in my .gitconfig but it's mostly to make them show up in chunk headers in diffs.

[diff "elisp"]
xfuncname="^\\((((def\\S+)|use-package)\\s+\\S+)"
[diff "org"]
xfuncname="^\\*+ +(.*)$"