1
0
Fork 0

fish: git prompt and alias fix

This commit is contained in:
Von Random 2023-02-06 13:38:34 +02:00
parent 5900e5b4b9
commit ed8d249300
2 changed files with 3 additions and 3 deletions

View file

@ -1,3 +1,3 @@
function gwtp function gwtp
command git worktree prune $argv command git worktree prune --verbose
end end

View file

@ -1,8 +1,8 @@
function prompt.git function prompt.git
git rev-parse 2>/dev/null || return git rev-parse 2> /dev/null || return
git status --porcelain -bu | while read line git status --porcelain -bu | while read line
if string match -qr "^##" "$line" if string match -qr "^##" "$line"
set git_branch (string match -r "\ (.+)\.\.\." "$line")[2] set git_branch (string match -r '[^# .]+' "$line")
string match -qr '\[behind' $line && set git_branch "$git_branch?" string match -qr '\[behind' $line && set git_branch "$git_branch?"
string match -qr '\[ahead' $line && set git_branch "$git_branch!" string match -qr '\[ahead' $line && set git_branch "$git_branch!"
prompt.add "$color_git_branch" "$git_sign $git_branch" prompt.add "$color_git_branch" "$git_sign $git_branch"