Created
March 15, 2013 06:37
-
-
Save fetep/5167906 to your computer and use it in GitHub Desktop.
Revisions
-
fetep created this gist
Mar 15, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ 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