#!/bin/bash
. ~/.profile.d/gentoo.sh
+. ~/.profile.d/aliases.sh
op=${0##*/}
-op=${op%-close}
+ops=( ${op//-/ } )
+op=${ops[0]}
+[[ ${op} == "er" ]] && op+=" -q"
tdir="${HOME}/.cache/bugz"
mkdir -p "${tdir}"
find "${tdir}" -mmin +30 -type f -delete
name=$(xml sel -E utf8 -t -m bugzilla/bug/long_desc -v who -n $xml | \
head -${c} | tail -1 | cut -d@ -f1)
fi
+ new_name=$(echo "${name}" | scrub_html | sed "s: [(\"'][^()\"']*[)\"']::g")
+ if [[ ${new_name} != "${name}" ]] ; then
+ echo "Normalizing '${name}' to '${new_name}'"
+ name=${new_name}
+ fi
if [[ -n ${cl_msg} ]] ; then
cl_msg+=" "
for (( n=0; n < ${#bugs[@]}; ++n )) ; do
b=${bugs[$n]}
c=${comments[$n]}
- run "$@" gbugz -q modify ${b} --fixed -c "\
+ local msg="Commit message: $c$(printf '\n%s' ${urls})"
+
+ case ${ops[1]} in
+ close)
+ run "$@" gbugz -q modify ${b} --fixed -c "\
should be all set now in the tree; thanks for the report!
-Commit message: $c$(printf '\n%s' ${urls})"
+${msg}"
+ ;;
+ comment)
+ run "$@" gbugz -q modify ${b} -c "${msg}"
+ ;;
+ esac
done
echo
}
t=$(mktemp)
echo "${cmds}" > "${t}"
${EDITOR:-nano} "${t}" || rm "${t}"
+ set -e
. "${t}"
rm "${t}"
;;