]> Sergey Matveev's repositories - schwabrak.git/blobdiff - comment-list
More colours
[schwabrak.git] / comment-list
index 284cd723ab9ccf786d2c07be95f7bd0c07d23e8e9a9756d59d22449df0e8b853..c2a673cdc21446bc1b10d1d64d9c810a9f13cc1105084edba8122860e0fddc4e 100755 (executable)
@@ -3,14 +3,15 @@
 root=$0:h:a
 . $root/lib.zsh.rc
 
+[[ -n $NO_COLOR ]] || coloured_git=--color
+
 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
+    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
 }