Loading .shell/funcs +19 −5 Original line number Diff line number Diff line Loading @@ -63,6 +63,22 @@ get_shell() echo sh } git_check() { local v GIT_VERSION=0 for v in `git --version|cut -f -d\ |tr '.' ' '`; do let 'GIT_VERSION = (GIT_VERSION << 8) + (v & 0xff)' done if [ $GIT_VERSION -gt 0x020800 ]; then local numcpu=`lscpu -p|grep '^[^#]'|wc -l` GIT_JOBS="--jobs $(((numcpu>1)?(numcpu-1):(numcpu)))" else GIT_JOBS= fi } update_worktree() { local upstream=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` Loading @@ -72,7 +88,7 @@ update_worktree() local original=`git rev-parse HEAD` if git merge --ff --no-edit $upstream origin/master; then git submodule sync --recursive git submodule update --init --recursive git submodule update --init --recursive ${GIT_JOBS} else git reset $original fi Loading @@ -86,11 +102,8 @@ update_repos() git worktree add -f $worktree --detach origin/master cd $worktree local numcpu=`lscpu -p|grep '^[^#]'|wc -l` git submodule sync --recursive git submodule update --init --recursive \ -j $(((numcpu>1)?(numcpu-1):(numcpu))) git submodule update --init --recursive ${GIT_JOBS} git submodule foreach --recursive ' setting="submodule.${name}.auto-update"; Loading Loading @@ -148,6 +161,7 @@ do_update() (cd ~ set -eu git_check && update_repos && update_worktree ) || return Loading Loading
.shell/funcs +19 −5 Original line number Diff line number Diff line Loading @@ -63,6 +63,22 @@ get_shell() echo sh } git_check() { local v GIT_VERSION=0 for v in `git --version|cut -f -d\ |tr '.' ' '`; do let 'GIT_VERSION = (GIT_VERSION << 8) + (v & 0xff)' done if [ $GIT_VERSION -gt 0x020800 ]; then local numcpu=`lscpu -p|grep '^[^#]'|wc -l` GIT_JOBS="--jobs $(((numcpu>1)?(numcpu-1):(numcpu)))" else GIT_JOBS= fi } update_worktree() { local upstream=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` Loading @@ -72,7 +88,7 @@ update_worktree() local original=`git rev-parse HEAD` if git merge --ff --no-edit $upstream origin/master; then git submodule sync --recursive git submodule update --init --recursive git submodule update --init --recursive ${GIT_JOBS} else git reset $original fi Loading @@ -86,11 +102,8 @@ update_repos() git worktree add -f $worktree --detach origin/master cd $worktree local numcpu=`lscpu -p|grep '^[^#]'|wc -l` git submodule sync --recursive git submodule update --init --recursive \ -j $(((numcpu>1)?(numcpu-1):(numcpu))) git submodule update --init --recursive ${GIT_JOBS} git submodule foreach --recursive ' setting="submodule.${name}.auto-update"; Loading Loading @@ -148,6 +161,7 @@ do_update() (cd ~ set -eu git_check && update_repos && update_worktree ) || return Loading