[PATCH util/modular] release.sh: adjust for changed git status exit codes.

Peter Hutterer peter.hutterer at who-t.net
Tue May 11 15:43:41 PDT 2010


git status in git-1.7 always returns 0, regardless of the number of
uncommitted changes. Replace this with a script to parse through the git
status output (ignoring uncommitted files).

[commit 9e4b7ab652561e1807702fe5288e04b8873fc437
 git status: not "commit --dry-run" anymore
 in the git source tree]

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 release.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/release.sh b/release.sh
index c8461fc..a37db95 100755
--- a/release.sh
+++ b/release.sh
@@ -129,8 +129,8 @@ if [ "x$ignorechanges" != "x1" ]; then
         abort_for_changes
     fi
 
-    git status > /dev/null 2>&1
-    if [ $? -eq 0 ]; then
+    uncommitted=`git status --porcelain -uno | grep -v "^ M" | wc -l`
+    if [ $uncommitted -ne 0 ]; then
         abort_for_changes
     fi
     set -e
-- 
1.7.0.1



More information about the xorg-devel mailing list