]> Sergey Matveev's repositories - schwabrak.git/blobdiff - comment-list
More intro links
[schwabrak.git] / comment-list
index 284cd723ab9ccf786d2c07be95f7bd0c07d23e8e9a9756d59d22449df0e8b853..1565bb8122b29b3bca7821972e2f1a92790dd94aa15cd17c9f046ea8820c32f2 100755 (executable)
@@ -3,14 +3,16 @@
 root=$0:h:a
 . $root/lib.zsh.rc
 
+[[ -n $NO_COLOR ]] || coloured_git=--color
+
 issue=${1#issues/}
+[[ -e issues/$issue/comment ]] || exit 0
 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
+    header=`git show $coloured_git --no-patch --format=format:"%CgreenWhen: %ai%Creset%n%CredAuthor: %an <%ae>%Creset%n%CblueComment:%Creset" ${hashes[$i]}`
     print $header
-    print Comment:
     print $comment
     [[ $i -eq 1 ]] || print
 }