Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.