Skip to content

Instantly share code, notes, and snippets.

@kuniyoshi
Last active December 23, 2015 01:01
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 kuniyoshi/1cb15c959d0733c40226 to your computer and use it in GitHub Desktop.
Save kuniyoshi/1cb15c959d0733c40226 to your computer and use it in GitHub Desktop.
count diff
#!/bin/bash
date +%FT%T
git diff --stat 2>/dev/null | tail -1
git status --untracked-files=all \
| awk '/Untracked files/{p=1} p {print $1}' \
| awk '/\.cpp$/ { print$1 } /\.h$/ { print$1 }' \
| xargs wc \
| awk '/\.cpp$/{++count} /\.h$/{++count} /total/{print count, "new files", $1, "new lines"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment