From 228fa382406e0a0bb4f230b77888a44fbc69d872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20Smyku=C5=82a?= Date: Tue, 18 Jun 2013 22:26:01 +0200 Subject: [PATCH] Renaming, cleanup --- share/functions/__fish_git_prompt.fish | 13 +++++-------- .../web_config/sample_prompts/informative_git.fish | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index 1b0b187aa..9b333aa15 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -233,14 +233,14 @@ function __fish_git_prompt --description "Prompt function for Git" set -l u #untracked set -l c (__fish_git_prompt_current_branch_bare) set -l p #upstream - set -l status_info + set -l informative_status __fish_git_prompt_validate_chars if test "true" = (git rev-parse --is-inside-work-tree ^/dev/null) - if test -n "$__fish_git_prompt_show_status" - set status_info "|"(__fish_git_prompt_status_info) + if test -n "$__fish_git_prompt_show_informative_status" + set informative_status "|"(__fish_git_prompt_informative_status) else if test -n "$__fish_git_prompt_showdirtystate" set -l config (git config --bool bash.showDirtyState) @@ -306,7 +306,7 @@ function __fish_git_prompt --description "Prompt function for Git" set format " (%s)" end - printf "%s$format%s" "$___fish_git_prompt_color_prefix" "$___fish_git_prompt_color_prefix_done$c$b$f$r$p$status_info$___fish_git_prompt_color_suffix" "$___git_ps_color_suffix_done" + printf "%s$format%s" "$___fish_git_prompt_color_prefix" "$___fish_git_prompt_color_prefix_done$c$b$f$r$p$informative_status$___fish_git_prompt_color_suffix" "$___git_ps_color_suffix_done" end ### helper functions @@ -334,7 +334,7 @@ function __fish_git_prompt_dirty --description "__fish_git_prompt helper, tells echo $dirty end -function __fish_git_prompt_status_info +function __fish_git_prompt_informative_status set -l changedFiles (git diff --name-status | cut -c 1-2) set -l stagedFiles (git diff --staged --name-status | cut -c 1-2) @@ -346,9 +346,6 @@ function __fish_git_prompt_status_info set -l info - __fish_git_prompt_validate_colors - __fish_git_prompt_validate_chars - if [ (math $dirtystate + $invalidstate + $stagedstate + $untrackedfiles) = 0 ] set info $___fish_git_prompt_color_cleanstate$___fish_git_prompt_char_cleanstate$___fish_git_prompt_color_cleanstate_done else diff --git a/share/tools/web_config/sample_prompts/informative_git.fish b/share/tools/web_config/sample_prompts/informative_git.fish index f88150736..466b40515 100644 --- a/share/tools/web_config/sample_prompts/informative_git.fish +++ b/share/tools/web_config/sample_prompts/informative_git.fish @@ -1,7 +1,7 @@ # name: Informative Git Prompt # author: Mariusz Smykula -set -g __fish_git_prompt_show_status 1 +set -g __fish_git_prompt_show_informative_status 1 set -g __fish_git_prompt_hide_untrackedfiles 1 set -g __fish_git_prompt_color_branch magenta bold