cmd=sync
shift
;;
+rb-all)
+ cmd=rebase
+ shift
+ set -- all "$@"
+ ;;
*)
cmd=$1
shift
repo_root() {
local root=${PWD}
- while [[ ! -d ${root}/.repo && ${root} != "/" ]] ; do
+ while [[ ! -d ${root}/.repo && ${root:-/} != "/" ]] ; do
root=${root%/*}
done
echo "${root}"
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}
if [[ $1 == "all" ]] ; then
shift
if [[ $# -eq 0 ]] ; then
- eval $(bash-colors --env | sed 's:^:export :')
+ eval "$(bash-colors --env | sed 's:^:export :')"
root=$(repo_root)
mj_init
while read -a line ; do
continue
fi
(
- out=$(env _proj=${proj} r rb all . 2>&1)
+ out=$(r rb all . 2>&1)
if [[ -n ${out} ]] ; then
- while read line ; do
- if [[ ${line} == "# "* ]] ; then
- 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
- done < <(echo "${out}")
+ head=$(printf "%-40s" "${proj}")
+ echo "${out}" | sed "s:^:${head} :"
fi
_mj_child
) &
#exec r forall -p -c 'r rb all .' </dev/null
fi
- branches=$(g b | awk '
- {
- if ($0 ~ "^[*] *[(]no branch[)]") {
- next
- } else if ($0 ~ "^[*] *[(](HEAD )?detached (from|at) ") {
- next
- } else if ($1 == "*") {
- b = $2
- } else {
- list = list $1 " "
- }
- }
- END { print list b }')
- [[ -z ${branches} ]] && exit 0
-
- [[ -z ${GOOD} ]] && eval $(bash-colors --env)
- #echo "${GOOD}### ${PWD}${NORMAL}"
- # Skip if rebase is in progress.
- if [[ -e .git/rebase-merge/interactive ]] ; then
- echo -e "# ${_proj}: ${WARN}skipping due to active rebase${NORMAL}"
- exit 1
- fi
- for b in ${branches} ; do
- #echo " ${HILITE}### $b${NORMAL}"
- g co -q $b || exit 1
- if ! r rb -q "$@" ; then
- g rb-a
- fi
- done
- exit 0
+ exec git rb-all -q
fi
;;
clean)