]> git.wh0rd.org - home.git/blobdiff - .bin/r
r: handle OWNERS paths
[home.git] / .bin / r
diff --git a/.bin/r b/.bin/r
index 24fc5e4090645fdbb32d926cbfecef8fa8544e90..a969597655a52ff8dec24afdd286d64a705cbfab 100755 (executable)
--- a/.bin/r
+++ b/.bin/r
@@ -17,6 +17,11 @@ s)
        cmd=sync
        shift
        ;;
+rb-all)
+       cmd=rebase
+       shift
+       set -- all "$@"
+       ;;
 *)
        cmd=$1
        shift
@@ -54,7 +59,7 @@ mj_finish() {
 
 repo_root() {
        local root=${PWD}
-       while [[ ! -d ${root}/.repo && ${root} != "/" ]] ; do
+       while [[ ! -d ${root}/.repo && ${root:-/} != "/" ]] ; do
                root=${root%/*}
        done
        echo "${root}"
@@ -64,7 +69,7 @@ process_reviewers() {
        local r arr=()
        for r in ${*//,/ } ; do
                case ${r} in
-               *OWNERS)
+               OWNERS*|*/OWNERS*)
                        local owners=$(
                                awk -F'@' '
                                        ($2 == "chromium.org" || $2 == "google.com") {list = list "," $1}
@@ -146,14 +151,18 @@ rebase)
                                out=$(env _proj=${proj} r rb all . 2>&1)
                                if [[ -n ${out} ]] ; then
                                        while read line ; do
-                                               if [[ ${line} == "# "* ]] ; then
+                                               case ${line} in
+                                               "Fast-forwarded "*) ;;
+                                               "# "*)
                                                        line="${line#[#] }"
                                                        printf '%s### %s%-40s%s: %s\n' \
                                                                "${BRACKET}" "${GOOD}" "${line%%:*}" "${NORMAL}" "${line#*:}"
-                                               else
+                                                       ;;
+                                               *)
                                                        printf '%s### %s%-40s%s: ERROR: %s\n' \
                                                                "${BRACKET}" "${BAD}" "${dir}" "${NORMAL}" "${line}"
-                                               fi
+                                                       ;;
+                                               esac
                                        done < <(echo "${out}")
                                fi
                                _mj_child