From ed8d24930036165e6f8bafce7fd8d04047220198 Mon Sep 17 00:00:00 2001 From: Von Random Date: Mon, 6 Feb 2023 13:38:34 +0200 Subject: [PATCH] fish: git prompt and alias fix --- cli/.config/fish/functions/gwtp.fish | 2 +- cli/.config/fish/functions/prompt.git.fish | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/.config/fish/functions/gwtp.fish b/cli/.config/fish/functions/gwtp.fish index 6b54bb7..9c2fd3d 100644 --- a/cli/.config/fish/functions/gwtp.fish +++ b/cli/.config/fish/functions/gwtp.fish @@ -1,3 +1,3 @@ function gwtp - command git worktree prune $argv + command git worktree prune --verbose end diff --git a/cli/.config/fish/functions/prompt.git.fish b/cli/.config/fish/functions/prompt.git.fish index 6f00bcc..fed6f56 100644 --- a/cli/.config/fish/functions/prompt.git.fish +++ b/cli/.config/fish/functions/prompt.git.fish @@ -1,8 +1,8 @@ function prompt.git - git rev-parse 2>/dev/null || return + git rev-parse 2> /dev/null || return git status --porcelain -bu | while read 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 '\[ahead' $line && set git_branch "$git_branch!" prompt.add "$color_git_branch" "$git_sign $git_branch"