From fc82840132b0b618e050cd14c8a19bf58fcda6bd Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Wed, 8 Jun 2022 21:11:11 +0200 Subject: [PATCH] terlar prompt: Also ignore untracked files unless explicitly asked --- share/functions/__terlar_git_prompt.fish | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/functions/__terlar_git_prompt.fish b/share/functions/__terlar_git_prompt.fish index 070fda465..78c7791ac 100644 --- a/share/functions/__terlar_git_prompt.fish +++ b/share/functions/__terlar_git_prompt.fish @@ -33,7 +33,13 @@ function __terlar_git_prompt --description 'Write out the git prompt' echo -n '|' - set -l index (git status --porcelain 2>/dev/null|cut -c 1-2|sort -u) + # Ignore untracked files unless we're explicitly asked. + # This is dog slow. + set -l untr -uno + set -q __fish_git_prompt_showuntrackedfiles + and set untr -unormal + + set -l index (git -c core.fsmonitor= status --porcelain 2>/dev/null|cut -c 1-2|sort -u) if test -z "$index" set_color $fish_color_git_clean