Skip to content

Instantly share code, notes, and snippets.

@AVGP
Created August 10, 2015 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AVGP/35319edfaa9a3306073f to your computer and use it in GitHub Desktop.
Save AVGP/35319edfaa9a3306073f to your computer and use it in GitHub Desktop.
Small bash function that outputs the number of lines added and removed in a commit
DEFAULT="[37;40m"
RED="[31;40m"
GREEN="[32;40m"
hg_changes() {
echo -e "\e${RED}`hg log -pr $1 | grep '^+' | wc -l` Additions\e${DEFAULT}"; echo -e "\e${GREEN}`hg log -pr $1 | grep '^-' | wc -l` Deletions\e${DEFAULT}";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment