From d3bdab7a0f168e65849b2bc8863d9d7a8ef123aa Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 11 Sep 2013 22:37:42 -0400 Subject: [PATCH] r: support --re with GoB --- .bin/r | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.bin/r b/.bin/r index bbd6536..6a86466 100755 --- 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) -- 2.39.5