Improvements to git-repl

Fix history support by padding -e to read again, and forcing use of Bash instead of default shell (dash on Debian doesn't work).

Fix support of quotes in commands by using eval.

Don't show git help when pressing enter without typing a command.
This commit is contained in:
Dave James Miller 2012-03-26 22:37:43 +01:00 committed by TJ Holowaychuk
parent bbd32d870a
commit 8fcabe34a3

View file

@ -1,8 +1,8 @@
#!/bin/sh
#!/bin/bash
while true; do
# Readline
read -r -p "git> " cmd
read -e -r -p "git> " cmd
# EOF
test $? -ne 0 && break
@ -13,11 +13,12 @@ while true; do
# Built-in commands
case $cmd in
ls) cmd=ls-files;;
"") continue;;
quit) break;;
esac
# Execute
git $cmd
eval git "$cmd"
done
echo
echo