#!/usr/bin/sh -e line() { printf "%s++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" $blue } get_mail() { { IFS=:; set -- $KISS_PATH; unset IFS; } i=0 blue=$(tput setaf 4) for repo do git_root=$(git -C ${repo} rev-parse --show-toplevel) if [ -f ${git_root}/update ]; then shortlog=$(git -C ${git_root} log --pretty=oneline --follow -- update) while IFS= read -r line; do hash=$(echo ${line} | cut -d " " -f 1) git -C ${git_root} show ${hash}:update | tail -n +2 > /tmp/kiss-mail chmod +x /tmp/kiss-mail line printf "%sItem: %s\n" $blue $((i = i + 1)) git -C ${git_root} show -s ${hash} | \ awk -v blue="$blue" 'NR > 1 && NR < 4 {printf "%s%s\n", blue, $0}' git -C ${git_root} log --format=${blue}"Topic: "%B -n 1 ${hash} | \ head -n 1 line /tmp/kiss-mail | awk '{print}' # This normalizes the trailing newlines echo done << EOF ${shortlog} EOF fi done } get_mail | ${PAGER:-less -R} rm /tmp/kiss-mail