Permalink
Browse files

Git helpers

  • Loading branch information...
1 parent a771780 commit 218a2002e50e22fcdef2b97f8bcfa3f543d2ead1 @txus txus committed May 9, 2012
Showing with 26 additions and 4 deletions.
  1. +11 −4 gitconfig.erb
  2. +15 −0 githelpers
View
@@ -2,11 +2,18 @@
name = <%= print("Your Name: "); STDOUT.flush; STDIN.gets.chomp %>
email = <%= print("Your Email: "); STDOUT.flush; STDIN.gets.chomp %>
[alias]
- co = checkout
+ co = checkout
+ l = "!source ~/.githelpers && pretty_git_log"
+ la = !git l --all
+ r = !git l -30
+ ra = !git r --all
[color]
- diff = auto
- status = auto
- branch = auto
+ diff = auto
+ status = auto
+ branch = auto
+ ui = auto
+[merge]
+ tool = vimdiff
[core]
excludesfile = <%= ENV['HOME'] %>/.gitignore
editor = <%= print("Preferred git editor (vim?): "); STDOUT.flush; STDIN.gets.chomp %>
View
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+HASH="%C(yellow)%h%C(reset)"
+RELATIVE_TIME="%C(green)%ar%C(reset)"
+AUTHOR="%C(bold blue)%an%C(reset)"
+REFS="%C(red)%d%C(reset)"
+SUBJECT="%s"
+
+FORMAT="$HASH{$RELATIVE_TIME{$AUTHOR{$REFS $SUBJECT"
+
+function pretty_git_log() {
+ git log --graph --pretty="tformat:$FORMAT" $* |
+ column -t -s '{' |
+ less -FXRS
+}

0 comments on commit 218a200

Please sign in to comment.