Skip to content

Instantly share code, notes, and snippets.

@icgood
Created September 10, 2020 22:52
Show Gist options
  • Save icgood/19bbed589ead78515fb1c95ba558d9d8 to your computer and use it in GitHub Desktop.
Save icgood/19bbed589ead78515fb1c95ba558d9d8 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
# Install to $PATH
# Usage: git diff-stats
output=$(git diff $@)
echo + $(grep -e '^\+[^\+]' -e '^\+$' <<<"""$output""" | wc -l)
echo - $(grep -e '^\-[^\-]' -e '^\-$' <<<"""$output""" | wc -l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment