From f7850fbd786afcb3df5d3fadc2c8ebee3fa059f9 Mon Sep 17 00:00:00 2001 From: William Hilton Date: Thu, 29 Oct 2015 15:05:32 -0400 Subject: [PATCH] Fix get commit. Add get lg. Remove auto-stashing thing. --- bin/get | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/get b/bin/get index 0613557..86dac62 100755 --- a/bin/get +++ b/bin/get @@ -98,7 +98,7 @@ fi commit) echo "Parent commit: $(git log --abbrev-commit -1 --pretty=format:'%C(bold blue)%s%Creset %Cgreen(%cr)%Creset')" if [ -z "$2" ]; then - read -p 'Message: ' msg + read -ep 'Message: ' msg git commit -m "$msg" else git commit -m "$2" @@ -119,13 +119,13 @@ echo 'Switching to branch' if [ -z "$2" ]; then echo '! Specify branch name' else - git stash save --include-untracked --quiet 'get-branch autostash' # Save branch index state + #git stash save --include-untracked --quiet 'get-branch autostash' # Save branch index state if git rev-parse --verify --quiet "$2" > /dev/null; then git checkout "$2" else git checkout -b "$2" fi - git stash pop --quiet # Restore branch index state + #git stash pop --quiet # Restore branch index state fi ;; @@ -274,4 +274,11 @@ else fi ;; +lg) +git log --color \ + --graph \ + --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' \ + --abbrev-commit -10 "${@:2}" +;; + esac