From: Mike Frysinger Date: Thu, 13 Sep 2012 22:49:15 +0000 (-0400) Subject: add --re support to g-push X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=36fb485661ebbb71a0a6ae0a7b91b774cfcfe3a6;p=home.git add --re support to g-push --- diff --git a/.bin/r b/.bin/r index bb754d1..a90d969 100755 --- a/.bin/r +++ b/.bin/r @@ -117,9 +117,29 @@ g-push) fi remote_branch=${remote_branch#refs/heads/} + reviewers="" + while [[ $# -gt 0 ]] ; do + case $1 in + --re) + reviewers=$2 + shift + ;; + *) + err "unknown option: $1" + ;; + esac + shift + done + + git_args=() + if [[ -n ${reviewers} ]] ; then + reviewers=( ${reviewers//,/ } ) + git_args+=( "--receive-pack='git receive-pack ${reviewers[*]/#/--reviewer=}'" ) + fi + for remote in cros-internal cros origin ; do if g cfg --get "remote.${remote}.url" >/dev/null ; then - vr git push ${remote} ${branch}:refs/for/${remote_branch} + vr git push "${git_args[@]}" ${remote} ${branch}:refs/for/${remote_branch} exit $? fi done