Permalink
Browse files

Improved glg function

  • Loading branch information...
paulodeon committed Mar 2, 2011
1 parent befd505 commit ef71ad28e436abe017a29aaba793f6616fbfc4da
Showing with 11 additions and 2 deletions.
  1. +11 −2 bash/aliases/git
View
@@ -16,12 +16,21 @@ function gg() {
function glg() {
if [ -z "$1" ]; then
- git lg
+ git log --oneline --decorate --graph
else
- git lg -n$1
+ if is_integer $1; then
+ git log --oneline --decorate --graph -n$1 $2
+ else
+ git log --oneline --decorate --graph $1
+ fi
fi
}
+function is_integer() {
+ printf "%d" $1 > /dev/null 2>&1
+ return $?
+}
+
alias gco='git checkout'
alias gd='git diff HEAD'
alias gdmt='git diff HEAD | mate'

0 comments on commit ef71ad2

Please sign in to comment.