Skip to content

Instantly share code, notes, and snippets.

@pauladam
Created February 18, 2015 21:17
Show Gist options
  • Select an option

  • Save pauladam/eb9256c9e1098a6b50d6 to your computer and use it in GitHub Desktop.

Select an option

Save pauladam/eb9256c9e1098a6b50d6 to your computer and use it in GitHub Desktop.
cc recommender
#!/bin/sh
user=`git st | grep 'modified' | cut -d ":" -f 2 | tr -d ' ' | while read fn; do
git --no-pager blame $fn
done | cut -d " " -f 2- | cut -d ')' -f 1 | sed 's/[0-9].*//' | tr -d '(' | sort | uniq -c | sort -n | tail -r | head -n 1 | cut -d ' ' -f 3-`
echo $user
cat $1 > /tmp/commit-msg
echo '\n' > $1
echo "cc: $user" >> $1
cat /tmp/commit-msg >> $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment