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

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Oct 5 04:47:18 PDT 2010


 bin/g |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 09586ed6dee4e741b91ba19545b1aa5cd3839a4a
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Oct 5 13:45:54 2010 +0200

    Support for pre-action flags in bin/g
    
    the first pre-action flag supported is -f, that tell
    bin/g to apply the git command (which ever it is) to every git repository
    regardless of the completion of that git command for each repository.
    (the default, except for pull, status and grep is to stop after the
    first 'error'
    
    This was motivated by the need to do bin/g -f stash pop.

diff --git a/bin/g b/bin/g
index f6ba1fa..48b979e 100755
--- a/bin/g
+++ b/bin/g
@@ -20,6 +20,16 @@ COMMAND="$1"
 PAGER=
 RELATIVIZE=1
 PUSH_ALL=
+KEEP_GOING=0
+
+while [ "${COMMAND:0:1}" = "-" ] ; do
+    case "$COMMAND" in
+        -f) KEEP_GOING=1
+            ;;
+    esac
+    shift
+    COMMAND="$1"
+done
 
 case "$COMMAND" in
     apply)
@@ -169,10 +179,13 @@ for DIR in * ; do
                     ;;
                 grep)
                     # git grep return an 'error' if nothing is found
-                   # still we should continue grepping the other repos
+                    # still we should continue grepping the other repos
                     RETURN=0
                     ;;
             esac
+            if [  "$KEEP_GOING" = "1" ] ; then
+                RETURN=0
+            fi
 
             exit $RETURN
         ) || exit $?


More information about the ooo-build-commit mailing list