Skip to content

Instantly share code, notes, and snippets.

@chanian
Created August 9, 2012 03:33
Show Gist options
  • Save chanian/3300688 to your computer and use it in GitHub Desktop.
Save chanian/3300688 to your computer and use it in GitHub Desktop.
more git stats on a specific file
# 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";
}
@chanian
Copy link
Author

chanian commented Aug 13, 2012

Run this to get it now:

curl --silent "https://raw.github.com/gist/3300688/fccb51ca1e70c687bd34c79dc730aa3ba2548737/gitwho.sh" >> ~/.local.bash && source ~/.local.bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment