generate_email_footer
}
+# generate a pattern for testing if a string is a hash
+hpat="";__=1; while [ $__ -le 40 ] ; do hpat=${hpat}'[0-9a-f]';__=$(($__+1)); done
+function is_hash () {
+ local hash
+ hash=$1; shift
+ case $hash in $hpat) return 0;; *) return 1;; esac
+}
+
generate_email_header()
{
# --- Email (all stdout will be the email)
details="$refname_type, $short_refname,"
fi
local shortrev
- shortrev=$(echo $describe | cut -b1-8)
+ is_hash $describe && shortrev="$(cut -b1-8 <<< $describe).." || shortrev=$describe
# Generate header
cat <<-EOF
To: $recipients