#!/bin/sh # Usage: git-copyright-for-dir output="/tmp/git-copyright-for-dir-output.txt" # Make sure file doesn't already exist rm -rf $output echo "This may take a while depending on the size of the directory..." for f in `git ls-files`; do git blame -w -C -C -M -- $f | sed -e 's/[^(]*(\([^0-9]*\).*/\1/' -e 's/[\t ]*$//' >> $output done echo "Ordering data..." cat $output | sort | uniq -c | sort -nr # Clean up rm -rf $output