Created
March 15, 2013 06:37
-
-
Save fetep/5167906 to your computer and use it in GitHub Desktop.
This file contains 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
c0 fetep-vm(~) % cat bin/git-push-n | |
#!/bin/bash | |
if [ $# -ne 2 ]; then | |
echo "usage: git push-n <remote> <ref>" >&2 | |
exit 1 | |
fi | |
output=$(git push -n "$@" 2>&1) | |
git_rc=$? | |
echo "$output" >&2 | |
range=$( | |
echo $output | | |
sed -n -r -e 's,^.* ([0-9a-f]+\.\.[0-9a-f]+).*,\1,p' | |
) | |
if [ -n "$range" ]; then | |
exec git log $range | |
fi | |
exit $git_rc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment