From 0edb04685bfac6ba0373398f3e9ee561dbaae6bf Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 16 Nov 2014 21:39:05 -0500 Subject: codereview: make commit -a the default; warn about uncommitted changes at upload also update README.md for github Change-Id: I7d578a902ffed7f6d69780721e29a1972b6f6992 --- bin/codereview | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin/codereview') diff --git a/bin/codereview b/bin/codereview index 6fd3e11a..6606a5c6 100755 --- a/bin/codereview +++ b/bin/codereview @@ -59,7 +59,7 @@ case create if($show) { echo '% git branch '$branch' && git commit || git branch -d '$branch >[1=2] } - git branch $branch && git checkout $branch && git commit $* || git branch -d $branch + git branch $branch && git checkout $branch && git commit -a $* || git branch -d $branch case commit shift @@ -72,7 +72,7 @@ case commit $git commit $* exit $status } - $git commit --amend $* + $git commit --amend -a $* exit $status case upload @@ -88,6 +88,10 @@ case upload if(! 9 grep 'machine plan9port-review.googlesource.com' $HOME/.netrc >/dev/null >[2=1]) { echo 'codereview: warning: cannot find plan9port-review in netrc' >[1=2] } + if(! git status | 9 grep 'nothing to commit, working directory clean' >/dev/null) { + echo 'codereview: warning: local changes not yet committed' >[1=2] + git status + } $git push https://plan9port-review.googlesource.com/plan9 HEAD:refs/for/master >[2=1] | 9 sed 's/.* //' case sync -- cgit v1.2.3