Created
April 2, 2016 11:29
-
-
Save dspinellis/a30345d170aed2efc7b31326a30a9ada to your computer and use it in GitHub Desktop.
Most frequent one-line changes in a Git repository
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 | |
git log --pretty='SHA %H' --numstat | | |
awk '/^SHA/ {sha = $2} NF == 3 && $1 == 1 && $2 == 1 {print "git show --oneline --unified=0", sha, "--", $3}'| | |
sh | | |
sed -n '/^- /{;s/^-[ \t]*//;h;};/^+ /{s/^+[ \t]*//;H;g;s/\n/$/;p;}' | | |
sort | | |
uniq -c | | |
sort -rn | | |
head |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment