]> git.wh0rd.org Git - home.git/commitdiff
add --re support to g-push
authorMike Frysinger <vapier@gentoo.org>
Thu, 13 Sep 2012 22:49:15 +0000 (18:49 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 13 Sep 2012 22:49:15 +0000 (18:49 -0400)
.bin/r

diff --git a/.bin/r b/.bin/r
index bb754d16e11e979b5f482852d28b173ec7084fb2..a90d969aca19e962bc0eb6c31eb7cfaea9c6d540 100755 (executable)
--- 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