chiark / gitweb /
Release 0.14
[stgit] / contrib / stgbashprompt.sh
index 16bb39bba711d9a24e69ed82c7f44eeb6dfca641..5927e679e5c676376f580331552632a72e4b2a0b 100755 (executable)
@@ -8,9 +8,9 @@ if [ "$PS1" ]; then
                git_dir=$(git-rev-parse --git-dir 2> /dev/null) || return
                ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
                br=${ref#refs/heads/}
-               top=$(cat $git_dir/patches/$br/current 2>/dev/null) \
-                       && top="/$top"
-               echo "[$br$top]"
+               top=$(tail -n 1 $git_dir/patches/$br/applied 2>/dev/null) \
+               top=${top:-(none)}
+               echo "[$top@$br]"
        }
        PS1='\u@\h:$(__prompt_git)\W\$ '
 fi