[ooo-build-commit] .: bin/g

Miklos Vajna vmiklos at kemper.freedesktop.org
Tue Sep 7 01:26:27 PDT 2010


 bin/g |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit eb1df3fcc92fe710dc5f728992fc30fad3075fa7
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Mon Sep 6 22:24:01 2010 +0200

    bin/g: don't use git status
    
    Its output is not guaranteed to be stable, use low level ("plumbing")
    git commands instead.

diff --git a/bin/g b/bin/g
index 5d156e7..ade9f56 100755
--- a/bin/g
+++ b/bin/g
@@ -128,17 +128,17 @@ for DIR in * ; do
                     done
                     ;;
                 commit)
-                    git status | grep -qs '^nothing to commit' && exit 0
+                    [ -z "`git diff-index --name-only HEAD --`" ] && exit 0
                     ;;
                 push)
                     if [ "$PUSH_ALL" != "1" ] ; then
-                        git status | grep -qs '^# Your branch is ahead of' || exit 0
+                        [ -n "`git rev-list HEAD@{upstream}..`" ] || exit 0
                     fi
                     ;;
                 status)
-                    AHEAD="`git status | grep '^# Your branch is ahead of'`"
-                    if [ -z "$AHEAD" ] ; then
-                        git status | grep -qs '^nothing to commit' && exit 0
+                    LOCALCOMMITS="`git rev-list HEAD@{upstream}..`"
+                    if [ -z "$LOCALCOMMITS" ] ; then
+                        [ -z "`git diff-index --name-only HEAD --`" ] && exit 0
                     fi
                     ;;
             esac
@@ -194,4 +194,4 @@ if [ "$COMMAND" = "apply" ] ; then
     echo
 fi
 
-# vi:set expandtab:
+# vi:set shiftwidth=4 expandtab:


More information about the ooo-build-commit mailing list