diff --git a/bin/git-repl b/bin/git-repl index c7de1b2..c92a954 100755 --- a/bin/git-repl +++ b/bin/git-repl @@ -1,8 +1,19 @@ #!/bin/bash while true; do + # Current branch + cur=`git symbolic-ref HEAD 2> /dev/null | cut -d/ -f3-` + + # Prompt + if [ $cur ] + then + prompt="git ($cur)> " + else + prompt="git> " + fi + # Readline - read -e -r -p "git> " cmd + read -e -r -p "$prompt" cmd # EOF test $? -ne 0 && break