diff --git a/scripts/pgit.sh b/scripts/pgit.sh index 5ab1b254..63d2095f 100644 --- a/scripts/pgit.sh +++ b/scripts/pgit.sh @@ -32,6 +32,20 @@ config() } # ------------- commands +run() +{( + local d + local cmd=$1 + shift + config + cd $pdir + + for d in $pdirs; do + marker $d + (cd $d; git $cmd "$@") + done +)} + clone() {( local p @@ -51,28 +65,6 @@ clone() done )} -pull() -{( - local d - config - cd $pdir - for d in $pdirs; do - marker "$d" - (cd $d; git pull "$@") - done -)} - -branch() -{( - local d - config - cd $pdir - for d in $pdirs; do - marker "$d" - (cd $d; git branch "$@") - done -)} - diff() {( local d @@ -84,30 +76,14 @@ diff() done )} -commit() -{( - local d - config - cd $pdir - - for d in $pdirs; do - marker $d - (cd $d; git commit "$@") - done -)} - -push() -{( - local d - config - cd $pdir - for d in $pdirs; do - marker $d - (cd $d; git push "$@") - done -)} - cmd=$1 shift -$cmd "$@" +case $cmd in + clone|diff) + $cmd "$@" + ;; + *) + run $cmd "$@" + ;; +esac