#!/usr/bin/env zsh root=$0:h:a . $root/lib.zsh.rc issue=${1#issues/} hashes=(`git log --format=format:%H issues/$issue/comment`) for i ({${#hashes}..1}) { header=`git show --no-patch --format=format:"When: %ai%nAuthor: %an <%ae>" ${hashes[$i]}` comment=`git cat-file blob ${hashes[$i]}:issues/$issue/comment | sed "s/^/+ /"` [[ -n $comment ]] || continue print $header print Comment: print $comment [[ $i -eq 1 ]] || print }