From 9d25ba78c093222a048f15fec34578a1c53a01fd Mon Sep 17 00:00:00 2001 From: Eyal Kaspi Date: Thu, 1 Aug 2013 17:42:33 -0700 Subject: [PATCH] git rainbow --- git-rainbow | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 git-rainbow diff --git a/git-rainbow b/git-rainbow new file mode 100755 index 0000000..0bfee0c --- /dev/null +++ b/git-rainbow @@ -0,0 +1,16 @@ +#!/bin/sh +clear +declare -a colors=("blue" "green" "red" ) +declare -a colors2=("blue" "green" "red" cyan yellow magenta "bold blue") +lines=$1 +[[ -z $lines ]] && lines=10 +while true; do + l=${#colors[@]} + l2=${#colors2[@]} + c1=${colors[(($RANDOM%$l))]} + c2=${colors2[(($RANDOM%$l2))]} + c3=${colors[(($RANDOM%$l))]} + c4=${colors2[(($RANDOM%$l2))]} + echo "\033[12A" + git log --graph --pretty="format:'%C${c1}%h%Creset -%C($c2)%d%Creset %s %C$c3(%cr) %C($c4)<%an>%Creset" --abbrev-commit --date=relative -$lines +done