X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.bin%2Fr;h=9aa76a868ec1a187e21584f0d1946a1140ea70d1;hb=0342453cae59711cc452aa428193af7d85394d0f;hp=a969597655a52ff8dec24afdd286d64a705cbfab;hpb=a5f629de0d2669846d3b30fe8a38dfca79d92aae;p=home.git diff --git a/.bin/r b/.bin/r index a969597..9aa76a8 100755 --- a/.bin/r +++ b/.bin/r @@ -8,25 +8,11 @@ case $1 in esac case $1 in -""|-*) ;; -l) - cmd=list - shift - ;; -s) - cmd=sync - shift - ;; rb-all) cmd=rebase shift set -- all "$@" ;; -*) - cmd=$1 - shift - acmd=$(git config --get "alias.${cmd}" | sed 's: -.*::') - ;; esac mj_init() { @@ -137,7 +123,7 @@ rebase) 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 @@ -148,22 +134,10 @@ rebase) 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 - case ${line} in - "Fast-forwarded "*) ;; - "# "*) - line="${line#[#] }" - printf '%s### %s%-40s%s: %s\n' \ - "${BRACKET}" "${GOOD}" "${line%%:*}" "${NORMAL}" "${line#*:}" - ;; - *) - printf '%s### %s%-40s%s: ERROR: %s\n' \ - "${BRACKET}" "${BAD}" "${dir}" "${NORMAL}" "${line}" - ;; - esac - done < <(echo "${out}") + head=$(printf "%-40s" "${proj}") + echo "${out}" | sed "s:^:${head} :" fi _mj_child ) & @@ -174,36 +148,7 @@ rebase) #exec r forall -p -c 'r rb all .' /dev/null && break - done - fi - review=$(g cfg --get "remote.${remote}.review") - remote_branch=${remote_branch#refs/heads/} - - git_args=() - reviewers="" - while [[ $# -gt 0 ]] ; do - case $1 in - --re) - process_reviewers "$2" - shift - ;; - -n|--dry-run|--draft) - git_args+=( $1 ) - ;; - *) - err "unknown option: $1" - ;; - esac - shift - done - - ref_spec="${branch}:refs/for/${remote_branch}" - if [[ -n ${reviewers} ]] ; then - reviewers=( ${reviewers//,/ } ) - 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} ${ref_spec} && exit - err "could not figure out remote to push to" - ;; -sync) - set -- -j16 -c "$@" - ;; upload) args=() while [[ $# -gt 0 ]] ; do @@ -361,4 +253,4 @@ email) ;; esac -exec python2 $(find_repo) ${acmd:-${cmd}} "$@" +exec $(find_repo) ${acmd:-${cmd}} "$@"