-
-
Save acg/41e147c15e36c6db87db5bd286c03ba3 to your computer and use it in GitHub Desktop.
Fast filewise git blame.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TZ=UTC git log --name-status --date=iso-strict-local --pretty="%ad%x09%ae" "$@" | | |
perl -F'/\t/' -lane ' | |
if (/^[ACDMRTUXB]/) { | |
$path = @F>2 ? $F[2] : $F[1]; | |
print "$date\t$email\t$path" if -e "$path"; | |
} elsif (@F) { | |
($date, $email)=@F; | |
} | |
' | | |
sort -k3,3 -k1,1r | | |
uniq -f2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment