mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
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.
25 lines
283 B
Bash
Executable file
25 lines
283 B
Bash
Executable file
#!/bin/bash
|
|
|
|
while true; do
|
|
# Readline
|
|
read -e -r -p "git> " cmd
|
|
|
|
# EOF
|
|
test $? -ne 0 && break
|
|
|
|
# History
|
|
history -s "$cmd"
|
|
|
|
# Built-in commands
|
|
case $cmd in
|
|
ls) cmd=ls-files;;
|
|
"") continue;;
|
|
quit) break;;
|
|
esac
|
|
|
|
# Execute
|
|
eval git "$cmd"
|
|
done
|
|
|
|
echo
|