Skip to content

Instantly share code, notes, and snippets.

@tedgrubb
Created May 22, 2014 21:01
Show Gist options
  • Save tedgrubb/6ac336046f3abecf3f07 to your computer and use it in GitHub Desktop.
Save tedgrubb/6ac336046f3abecf3f07 to your computer and use it in GitHub Desktop.
Find authors to assign a pull request based on the files you've changed
#!/bin/bash
# Setup:
# Add this file to your $PATH
# Usage:
# git assign
changed_files=$(git diff --name-only HEAD master)
authors=$(echo "$changed_files" | xargs -L1 git log --follow | grep Author:)
printf "Authors in order of commits made to these files:\n\n"
printf "$changed_files\n\n"
printf "$authors" | sort | uniq -c | sort -r | sed 's/Author:/Commits:/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment