#!/bin/bash #### #### Todo: #### - change line color based on the selected radio button #### - support collapsing lines per color/category (show/hide for each) #### - add category "next" and see if the prompt can handle that (eg: d3e379b3) #### - produce multiple lists on output (per category) allowing to save batches #### die() { [ "$#" -eq 0 ] || echo "$*" >&2 exit 1 } err() { echo "$*" >&2 } quit() { [ "$#" -eq 0 ] || echo "$*" exit 0 } #### Main USAGE="Usage: ${0##*/} [ -h ] [ -b 'bkp_list' ] patch..." MYSELF="$0" GITURL="http://git.haproxy.org/?p=haproxy.git;a=commitdiff;h=" ISSUES="https://github.com/haproxy/haproxy/issues/" BKP="" while [ -n "$1" -a -z "${1##-*}" ]; do case "$1" in -h|--help) quit "$USAGE" ;; -b) BKP="$2"; shift 2 ;; *) die "$USAGE" ;; esac done PATCHES=( "$@" ) if [ ${#PATCHES[@]} = 0 ]; then die "$USAGE" fi # BKP is a space-delimited list of 8-char commit IDs, we'll # assign them to the local bkp[] associative array. declare -A bkp for cid in $BKP; do bkp[$cid]=1 done # some colors BG_B="#e0e0e0" BT_N="gray"; BG_N="white" BT_U="#00e000"; BG_U="#e0ffe0" BT_W="#0060ff"; BG_W="#e0e0ff" BT_Y="red"; BG_Y="#ffe0e0" echo "" cat <<- EOF
EOF echo "" echo -n "Show:" echo -n " B (${#bkp[*]}) " echo -n " N (0) " echo -n " U (0) " echo -n " W (0) " echo -n " Y (0) " echo -n " (B=show backported, N=no/drop, U=uncertain, W=wait/next, Y=yes/pick" echo ")" echo "All | CID | Subject | Verdict N U W Y | Reason |
---|---|---|---|---|
$seq_num " echo -n " | "
echo -n "$cid${date:+ $date} | "
echo -n "${pnum:+$pnum }$subj${author:+ $author } | "
echo -n "" echo -n "" echo -n "" echo -n "" echo -n "" echo -n " | " echo -n "$resp | " echo "
New | CID | Subject | Verdict N U W Y | Reason |