X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=blobdiff_plain;f=pull-usrlocalsrc;h=085520632d821711b13f35786d6057eae48e67c9;hp=2f4c029cb6a4b1d26d8d420a6b99393e29e2246f;hb=2c654e316392a8b3523ea0495902372d54548e1c;hpb=9c97e2737a3465ed07137b8591a9adec85d45351 diff --git a/pull-usrlocalsrc b/pull-usrlocalsrc index 2f4c029..0855206 100755 --- a/pull-usrlocalsrc +++ b/pull-usrlocalsrc @@ -1,9 +1,19 @@ #! /bin/sh +PATH=/usr/local/src/Python/git-remote-hg:$PATH + +has_remote() { + git remote show "$1" >/dev/null 2>&1 +} + prog_dir="`dirname \"$0\"`" && cat "$prog_dir"/locate-all.list | grep -F /usr/local/src | -while true; do - read d || exit 0 - echo "----- $d -----"; cd "$d" && git pull origin || exit 1 +while read d; do + echo "----- $d -----"; cd "$d" && + if has_remote source && has_remote origin; then + git pull source master && git push origin master || exit 1 + else + git remote | xargs -I'{}' git pull '{}' master || exit 1 + fi done