From: Mike Frysinger Date: Thu, 12 Sep 2013 02:37:42 +0000 (-0400) Subject: r: support --re with GoB X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=d3bdab7a0f168e65849b2bc8863d9d7a8ef123aa;p=home.git r: support --re with GoB --- 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)