From 8fcabe34a3ecc5d2350ce03305a6e05f4037329a Mon Sep 17 00:00:00 2001 From: Dave James Miller Date: Mon, 26 Mar 2012 22:37:43 +0100 Subject: [PATCH] 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. --- bin/git-repl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/git-repl b/bin/git-repl index e926912..c7de1b2 100755 --- a/bin/git-repl +++ b/bin/git-repl @@ -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 \ No newline at end of file +echo