[Libreoffice] [PATCH] support for pre-action flags in bin/g

Norbert Thiebaud nthiebaud at gmail.com
Mon Oct 4 15:16:17 PDT 2010


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.
---
 bin/g |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/bin/g b/bin/g
index f6ba1fa..767f6e8 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)
@@ -173,6 +183,9 @@ for DIR in * ; do
                    RETURN=0
                    ;;
            esac
+            if [  "$KEEP_GOING" = "1" ] ; then
+                RETURN=0
+            fi

            exit $RETURN
        ) || exit $?
--
1.7.1


More information about the LibreOffice mailing list