]> Sergey Matveev's repositories - schwabrak.git/blob - comment-list
Explicit empty line separator
[schwabrak.git] / comment-list
1 #!/usr/bin/env zsh
2
3 root=$0:h:a
4 . $root/lib.zsh.rc
5
6 [[ -n $NO_COLOR ]] || coloured_git=--color
7
8 issue=${1#issues/}
9 [[ -e issues/$issue/comment ]] || exit 0
10 hashes=(`git log --format=format:%H issues/$issue/comment`)
11 for i ({${#hashes}..1}) {
12     comment=`git cat-file blob ${hashes[$i]}:issues/$issue/comment | sed "s/^/+ /"`
13     [[ -n $comment ]] || continue
14     header=`git show $coloured_git --no-patch --format=format:"%CgreenWhen: %ai%Creset%n%CredAuthor: %an <%ae>%Creset%n%CblueComment:%Creset" ${hashes[$i]}`
15     print $header
16     print $comment
17     [[ $i -eq 1 ]] || print
18 }