Skip to content

Instantly share code, notes, and snippets.

@TheLonelyGhost
Created September 9, 2021 07:44
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 TheLonelyGhost/2dc50fe6eaa0679fdd581e056e20741b to your computer and use it in GitHub Desktop.
Save TheLonelyGhost/2dc50fe6eaa0679fdd581e056e20741b to your computer and use it in GitHub Desktop.
determine how many lines added and removed from a given commit-ish (ref, brach, whatever)
#!/usr/bin/env bash
set -euo pipefail
git diff --numstat "$@" | awk '{ sum_plus+=$1; sum_minus+=$2 } END { print("+++++ ", sum_plus); print("----- ", sum_minus); }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment