Last active
November 12, 2015 23:07
-
-
Save noisy/48114158802589908f56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To make sure, that proper refs are added to .git/config | |
# run: git config --add remote.origin.fetch "+refs/pull/*:refs/remotes/pr/*" | |
git fetch origin | |
touch last_update | |
pull_requests_refs="`git show-ref | grep "refs/remotes/pr/.*/head"`" | |
pull_requests="`echo "$pull_requests_refs" | sed -e "s#\([0-9a-f]*\)\ refs/remotes/pr/\(.*\)/head.*#pr\2 \1#g" | sort`" | |
changed_prs="`echo "$pull_requests" && cat last_update | sort | uniq -u`" | |
grep -F -x -v -f last_update <(echo "$changed_prs") | |
echo "$pull_requests" > last_update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment