]> Sergey Matveev's repositories - schwabrak.git/blob - comment-list
Colourify with supercat
[schwabrak.git] / comment-list
1 #!/usr/bin/env zsh
2
3 root=$0:h:a
4 . $root/lib.zsh.rc
5
6 issue=${1#issues/}
7 hashes=(`git log --format=format:%H issues/$issue/comment`)
8 for i ({${#hashes}..1}) {
9     header=`git show --no-patch --format=format:"When: %ai%nAuthor: %an <%ae>" ${hashes[$i]}`
10     comment=`git cat-file blob ${hashes[$i]}:issues/$issue/comment | sed "s/^/+ /"`
11     [[ -n $comment ]] || continue
12     print $header
13     print Comment:
14     print $comment
15     [[ $i -eq 1 ]] || print
16 }