Git Repository Scripts

LOC last changed by author

git ls-files | xargs -n1 git blame --line-porcelain \ | sed -n 's/^author //p' | sort -f | uniq -ic | sort -nr

Number of lines modified by me

find . -name '*.cs' \ ! -path '**/obj/**' \ ! -path '*.Generated.cs' \ ! -path '**/external/**' \ -exec git blame {} \\; \ | grep "Matthias Koch" | wc -l

Files sorted by LOC

find . -name '*.cs' \ ! -path '**/obj/**' \ ! -path '*.Generated.cs' \ ! -path '**/external/**' \ | xargs wc -l | sort -r -k1 -n

Unpushed / uncommitted

find . -type d -name ".git" \ -exec sh -c ' echo ------------ {} -------------- git --no-pager --git-dir={} --work-tree=$PWD/{}/.. log --branches --not --remotes --oneline git --no-pager --git-dir={} --work-tree=$PWD/{}/.. diff --name-only ' \\;