mirror of
https://github.com/tj/git-extras.git
synced 2026-09-12 16:36:22 -04:00
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:
parent
bbd32d870a
commit
8fcabe34a3
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue