esac
case $1 in
-""|-*) ;;
-l)
- cmd=list
- shift
- ;;
-s)
- cmd=sync
- shift
- ;;
rb-all)
cmd=rebase
shift
set -- all "$@"
;;
-*)
- cmd=$1
- shift
- acmd=$(git config --get "alias.${cmd}" | sed 's: -.*::')
- ;;
esac
mj_init() {
if [[ $1 == "all" ]] ; then
shift
if [[ $# -eq 0 ]] ; then
+ # This bash version is still slightly faster than repo!
+ #exec r forall -j$(getconf _NPROCESSORS_ONLN) -p -c git rb-all
+
eval "$(bash-colors --env | sed 's:^:export :')"
root=$(repo_root)
mj_init
continue
fi
(
- out=$(r rb all . 2>&1)
+ out=$(r rb-all . 2>&1)
if [[ -n ${out} ]] ; then
head=$(printf "%-40s" "${proj}")
echo "${out}" | sed "s:^:${head} :"
done < <(r l)
mj_finish
exit 0
- #exec r forall -p -c 'r rb all .' </dev/null
fi
exec git rb-all -q
exit 0
;;
-g-push)
- # For the times when repo is being stupid, push directly to gerrit myself.
- if ! branch=$(g symbolic-ref -q HEAD) ; then
- err "could not figure out active branch"
- fi
- branch=${branch#refs/heads/}
- if ! remote_branch=$(g cfg --get "branch.${branch}.merge") ; then
- echo "could not figure out remote branch; using ${branch}"
- remote_branch=${branch}
- fi
- if ! remote=$(g cfg --get "branch.${branch}.remote") ; then
- for remote in cros-internal cros origin ; do
- g cfg --get "remote.${remote}.url" >/dev/null && break
- done
- fi
- review=$(g cfg --get "remote.${remote}.review")
- remote_branch=${remote_branch#refs/heads/}
-
- git_args=()
- reviewers=""
- while [[ $# -gt 0 ]] ; do
- case $1 in
- --re)
- process_reviewers "$2"
- shift
- ;;
- -n|--dry-run|--draft)
- git_args+=( $1 )
- ;;
- *)
- err "unknown option: $1"
- ;;
- esac
- shift
- done
-
- ref_spec="${branch}:refs/for/${remote_branch}"
- if [[ -n ${reviewers} ]] ; then
- reviewers=( ${reviewers//,/ } )
- if [[ ${review} != ssh://* ]] ; then
- gob_args=$(printf 'r=%s,' "${reviewers[@]}")
- ref_spec+="%${gob_args%,}"
- else
- git_args+=( "--receive-pack=git receive-pack ${reviewers[*]/#/--reviewer=}" )
- fi
- fi
-
- vr git push "${git_args[@]}" ${remote} ${ref_spec} && exit
- err "could not figure out remote to push to"
- ;;
-sync)
- set -- -j16 -c "$@"
- ;;
upload)
args=()
while [[ $# -gt 0 ]] ; do
;;
esac
-exec python2 $(find_repo) ${acmd:-${cmd}} "$@"
+exec $(find_repo) ${acmd:-${cmd}} "$@"