]> git.wh0rd.org Git - home.git/commitdiff
r: support --re with GoB
authorMike Frysinger <vapier@gentoo.org>
Thu, 12 Sep 2013 02:37:42 +0000 (22:37 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 12 Sep 2013 02:37:42 +0000 (22:37 -0400)
.bin/r

diff --git a/.bin/r b/.bin/r
index bbd6536a67f6ea42c052e2ef0a9126870f4fb7ad..6a86466c38ecdedb3e53527b7699c15e4699ac62 100755 (executable)
--- a/.bin/r
+++ b/.bin/r
@@ -194,6 +194,7 @@ g-push)
                         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=()
@@ -214,12 +215,18 @@ g-push)
                shift
        done
 
+       ref_spec="${branch}:refs/for/${remote_branch}"
        if [[ -n ${reviewers} ]] ; then
                reviewers=( ${reviewers//,/ } )
-               git_args+=( "--receive-pack=git receive-pack ${reviewers[*]/#/--reviewer=}" )
+               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} ${branch}:refs/for/${remote_branch} && exit
+       vr git push "${git_args[@]}" ${remote} ${ref_spec} && exit
        err "could not figure out remote to push to"
        ;;
 sync)