|
|
@ -45,17 +45,19 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
usage() {
|
|
|
|
usage() {
|
|
|
|
cat <<EOF
|
|
|
|
cat <<EOF
|
|
|
|
Usage: git-crup [-n|--dry-run] [--fetch] [-j|--jobs [jobs]]
|
|
|
|
Usage: git-crup [-n|--dry-run] [--fetch|--sync] [-j|--jobs [jobs]]
|
|
|
|
[--no-hooks] [<args to git-pull or git-fetch>]
|
|
|
|
[--no-hooks] [<args to git-pull or git-fetch>]
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
serial_update() {
|
|
|
|
serial_update() {
|
|
|
|
( cd "$1"
|
|
|
|
( cd "$1"
|
|
|
|
$GIT_EXE $pull $pull_args -q origin | sed "s/^/[$1] /g"
|
|
|
|
if test -n "$toplevel_cmd"; then
|
|
|
|
|
|
|
|
$toplevel_cmd | sed "s/^/[$1] /g"
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
return $?
|
|
|
|
return $?
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
$GIT_EXE submodule --quiet sync
|
|
|
|
$GIT_EXE submodule --quiet sync
|
|
|
|
$GIT_EXE ls-files -s | grep ^160000 | awk '{print $4}' |
|
|
|
|
$GIT_EXE ls-files -s | grep ^160000 | awk '{print $4}' |
|
|
|
|
while read submod; do
|
|
|
|
while read submod; do
|
|
|
@ -93,6 +95,9 @@ while test $# -ne 0; do
|
|
|
|
--fetch)
|
|
|
|
--fetch)
|
|
|
|
pull=fetch
|
|
|
|
pull=fetch
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
|
|
|
|
--sync)
|
|
|
|
|
|
|
|
pull=
|
|
|
|
|
|
|
|
;;
|
|
|
|
--no-hooks|--nohooks)
|
|
|
|
--no-hooks|--nohooks)
|
|
|
|
hooks=no
|
|
|
|
hooks=no
|
|
|
|
;;
|
|
|
|
;;
|
|
|
@ -124,11 +129,17 @@ else
|
|
|
|
xargs_parallel=no
|
|
|
|
xargs_parallel=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if test -n "$pull"; then
|
|
|
|
|
|
|
|
toplevel_cmd="$GIT_EXE $pull $pull_args -q origin"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
toplevel_cmd=
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
set -o pipefail
|
|
|
|
set -o pipefail
|
|
|
|
if test "$xargs_parallel" = "yes"; then
|
|
|
|
if test "$xargs_parallel" = "yes"; then
|
|
|
|
( ls -d */.git | sed 's/\/\.git$//' |
|
|
|
|
( ls -d */.git | sed 's/\/\.git$//' |
|
|
|
|
xargs $max_lines $replace_arg -P "$j" \
|
|
|
|
xargs $max_lines $replace_arg -P "$j" \
|
|
|
|
"$crup_runner" replace_arg $GIT_EXE $pull $pull_args -q origin |
|
|
|
|
"$crup_runner" replace_arg $toplevel_cmd |
|
|
|
|
xargs $max_lines -P "$j" "$crup_runner" )
|
|
|
|
xargs $max_lines -P "$j" "$crup_runner" )
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ls -d */.git |
|
|
|
|
ls -d */.git |
|
|
|
|