chiark / gitweb /
Fix removal of series to nuke the formatversion config item.
[stgit] / contrib / stgbashprompt.sh
CommitLineData
2f5e43aa
RR
1# modify PS1 to your preference and include this file in your bashrc
2# or copy to /etc/bash_completions.d.
3
4if [ "$PS1" ]; then
5 function __prompt_git()
6 {
7 local git_dir ref br top;
8 git_dir=$(git-rev-parse --git-dir 2> /dev/null) || return
9 ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
10 br=${ref#refs/heads/}
330c6aff 11 top=$(tail -n 1 $git_dir/patches/$br/applied 2>/dev/null) \
34a1b4c2
RR
12 top=${top:-(none)}
13 echo "[$top@$br]"
2f5e43aa
RR
14 }
15 PS1='\u@\h:$(__prompt_git)\W\$ '
16fi