Edit the cover or patch message before e-mail encoding
[stgit/ydirson.git] / contrib / stgbashprompt.sh
blob16bb39bba711d9a24e69ed82c7f44eeb6dfca641
1 # modify PS1 to your preference and include this file in your bashrc
2 # or copy to /etc/bash_completions.d.
4 if [ "$PS1" ]; then
5 function __prompt_git()
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/}
11 top=$(cat $git_dir/patches/$br/current 2>/dev/null) \
12 && top="/$top"
13 echo "[$br$top]"
15 PS1='\u@\h:$(__prompt_git)\W\$ '