From: Mike Frysinger Date: Wed, 11 Apr 2012 16:01:15 +0000 (-0400) Subject: add repo OWNERS integration X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=8f20a215c0485e06312abb7847c772a93706849a;p=home.git add repo OWNERS integration --- diff --git a/.bin/r b/.bin/r index 518b266..8e240dc 100755 --- a/.bin/r +++ b/.bin/r @@ -1,5 +1,6 @@ #!/bin/bash g() { git "$@"; } +err() { printf '%b\n' "$*" 1>&2; exit 1; } case $1 in ""|-*) ;; @@ -53,8 +54,7 @@ sb-push) cd "${root}" || exit 1 if [[ ! -e .repo/sandbox-url ]] ; then - echo "Please configure remote url base in ${root}/.repo/sandbox-url" - exit 1 + err "Please configure remote url base in ${root}/.repo/sandbox-url" fi remote=$(<.repo/sandbox-url) || exit 1 @@ -88,6 +88,29 @@ sb-push) exit 0 ;; +upload) + args=() + while [[ $# -gt 0 ]] ; do + case $1 in + --re) + if [[ $2 == "OWNERS" ]] ; then + owners=$(awk -F'@' '{list = list "," $1} END {print substr(list, 2)}' OWNERS) + if [[ -z ${owners} ]] ; then + err "cannot find OWNERS list" + else + echo "Auto setting reviewers to: ${owners}" + fi + args+=( --re "${owners}" ) + shift 2 + continue + fi + ;; + esac + args+=( "$1" ) + shift + done + set -- "${args[@]}" + ;; esac exec repo ${acmd:-${cmd}} "$@"