mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Renaming, cleanup
This commit is contained in:
parent
a142c5e1ec
commit
228fa38240
2 changed files with 6 additions and 9 deletions
|
@ -233,14 +233,14 @@ function __fish_git_prompt --description "Prompt function for Git"
|
||||||
set -l u #untracked
|
set -l u #untracked
|
||||||
set -l c (__fish_git_prompt_current_branch_bare)
|
set -l c (__fish_git_prompt_current_branch_bare)
|
||||||
set -l p #upstream
|
set -l p #upstream
|
||||||
set -l status_info
|
set -l informative_status
|
||||||
|
|
||||||
__fish_git_prompt_validate_chars
|
__fish_git_prompt_validate_chars
|
||||||
|
|
||||||
if test "true" = (git rev-parse --is-inside-work-tree ^/dev/null)
|
if test "true" = (git rev-parse --is-inside-work-tree ^/dev/null)
|
||||||
|
|
||||||
if test -n "$__fish_git_prompt_show_status"
|
if test -n "$__fish_git_prompt_show_informative_status"
|
||||||
set status_info "|"(__fish_git_prompt_status_info)
|
set informative_status "|"(__fish_git_prompt_informative_status)
|
||||||
else
|
else
|
||||||
if test -n "$__fish_git_prompt_showdirtystate"
|
if test -n "$__fish_git_prompt_showdirtystate"
|
||||||
set -l config (git config --bool bash.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)"
|
set format " (%s)"
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
### helper functions
|
### helper functions
|
||||||
|
@ -334,7 +334,7 @@ function __fish_git_prompt_dirty --description "__fish_git_prompt helper, tells
|
||||||
echo $dirty
|
echo $dirty
|
||||||
end
|
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 changedFiles (git diff --name-status | cut -c 1-2)
|
||||||
set -l stagedFiles (git diff --staged --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
|
set -l info
|
||||||
|
|
||||||
__fish_git_prompt_validate_colors
|
|
||||||
__fish_git_prompt_validate_chars
|
|
||||||
|
|
||||||
if [ (math $dirtystate + $invalidstate + $stagedstate + $untrackedfiles) = 0 ]
|
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
|
set info $___fish_git_prompt_color_cleanstate$___fish_git_prompt_char_cleanstate$___fish_git_prompt_color_cleanstate_done
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# name: Informative Git Prompt
|
# name: Informative Git Prompt
|
||||||
# author: Mariusz Smykula <mariuszs at gmail.com>
|
# author: Mariusz Smykula <mariuszs at gmail.com>
|
||||||
|
|
||||||
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_hide_untrackedfiles 1
|
||||||
|
|
||||||
set -g __fish_git_prompt_color_branch magenta bold
|
set -g __fish_git_prompt_color_branch magenta bold
|
||||||
|
|
Loading…
Reference in a new issue