Fix get commit. Add get lg. Remove auto-stashing thing.

This commit is contained in:
William Hilton 2015-10-29 15:05:32 -04:00
parent d179392d9e
commit f7850fbd78

13
bin/get
View file

@ -98,7 +98,7 @@ fi
commit) commit)
echo "Parent commit: $(git log --abbrev-commit -1 --pretty=format:'%C(bold blue)%s%Creset %Cgreen(%cr)%Creset')" echo "Parent commit: $(git log --abbrev-commit -1 --pretty=format:'%C(bold blue)%s%Creset %Cgreen(%cr)%Creset')"
if [ -z "$2" ]; then if [ -z "$2" ]; then
read -p 'Message: ' msg read -ep 'Message: ' msg
git commit -m "$msg" git commit -m "$msg"
else else
git commit -m "$2" git commit -m "$2"
@ -119,13 +119,13 @@ echo 'Switching to branch'
if [ -z "$2" ]; then if [ -z "$2" ]; then
echo '! Specify branch name' echo '! Specify branch name'
else 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 if git rev-parse --verify --quiet "$2" > /dev/null; then
git checkout "$2" git checkout "$2"
else else
git checkout -b "$2" git checkout -b "$2"
fi fi
git stash pop --quiet # Restore branch index state #git stash pop --quiet # Restore branch index state
fi fi
;; ;;
@ -274,4 +274,11 @@ else
fi 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 esac