Follow
Ever wish you could see the history for just a single #Swift function in #git? You can use:
git log -L :function:file
But git doesn’t know how to find Swift functions by default. You can help it by following these instructions to add “Better diff hunk headers with Swift”: https://juripakaste.fi/swift-git-attributes/
Then the following example would show you all the changes to the login function in APIClient.swift:
git log -L :login:APIClient.swift