Created
August 9, 2012 03:33
-
-
Save chanian/3300688 to your computer and use it in GitHub Desktop.
more git stats on a specific file
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
# chuck this in your ~/.local.bash or ~/.bash_profile | |
# usage: gitwho filename | |
function gitwho() { | |
echo -e "\n File: $1"; | |
echo -n " Last Commit:"; | |
echo -e "\033[35m \c"; | |
git log --relative-date --pretty='%aN (%ad)' -n1 $1; | |
echo -e "\033[35m \c"; | |
echo -n " - "; | |
git log -n1 --format="%s" $1; | |
echo -e "\n\n By Live LOCs:\n ------------------"; | |
git blame $1 | cut -d"(" -f2 | cut -d"2" -f1 | sort | uniq -c | sort -r | head -15; | |
echo -e "\n By Commits:\n ------------------" | |
git log --format='%aN' -n10000 $1 | sort | uniq -ci | sort -r | head -15; | |
echo -e "\n\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this to get it now:
curl --silent "https://raw.github.com/gist/3300688/fccb51ca1e70c687bd34c79dc730aa3ba2548737/gitwho.sh" >> ~/.local.bash && source ~/.local.bash