Permalink
Browse files

highlight merge commits in red

  • Loading branch information...
1 parent 6e204b4 commit 5057bb00e905b9abfd09766c813ac09bb2695bea @garybernhardt committed Mar 30, 2013
Showing with 22 additions and 1 deletion.
  1. +22 −1 .githelpers
View
@@ -16,11 +16,30 @@
HASH="%C(yellow)%h%Creset"
RELATIVE_TIME="%Cgreen(%ar)%Creset"
AUTHOR="%C(bold blue)<%an>%Creset"
-REFS="%C(red)%d%Creset"
+REFS="%C(bold red)%d%Creset"
SUBJECT="%s"
FORMAT="$HASH}$RELATIVE_TIME}$AUTHOR}$REFS $SUBJECT"
+ANSI_BLACK='\033[30m'
+ANSI_BLACK_BOLD='\033[0;30;1m'
+ANSI_RED='\033[31m'
+ANSI_RED_BOLD='\033[0;31;1m'
+ANSI_GREEN='\033[32m'
+ANSI_GREEN_BOLD='\033[0;32;1m'
+ANSI_YELLOW='\033[33m'
+ANSI_YELLOW_BOLD='\033[0;33;1m'
+ANSI_BLUE='\033[34m'
+ANSI_BLUE_BOLD='\033[0;34;1m'
+ANSI_MAGENTA='\033[35m'
+ANSI_MAGENTA_BOLD='\033[0;35;1m'
+ANSI_CYAN='\033[36m'
+ANSI_CYAN_BOLD='\033[0;36;1m'
+ANSI_WHITE='\033[37m'
+ANSI_WHITE_BOLD='\033[0;37;1m'
+ANSI_RESET='\033[0m'
+
+
show_git_head() {
pretty_git_log -1
git show -p --pretty="tformat:"
@@ -34,6 +53,8 @@ pretty_git_log() {
sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?\)/\1)/' |
# Line columns up based on } delimiter
column -s '}' -t |
+ # Color merge commits specially
+ sed -Ee "s/(Merge branch .* into .*$)/$(printf $ANSI_RED)\1$(printf $ANSI_RESET)/" |
# Page only if we need to
less -FXRS
}

0 comments on commit 5057bb0

Please sign in to comment.