-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
When $__fish_git_prompt_show_informative_status is not set:
fish-shell/share/functions/fish_git_prompt.fish
Lines 414 to 418 in f75cf5c
| if test -n "$sha" | |
| set i (__fish_git_prompt_staged) | |
| else | |
| set i $___fish_git_prompt_char_invalidstate | |
| end |
fish-shell/share/functions/fish_git_prompt.fish
Lines 446 to 457 in f75cf5c
| if test -n "$w" | |
| set w "$___fish_git_prompt_color_dirtystate$w$___fish_git_prompt_color_dirtystate_done" | |
| end | |
| if test -n "$i" | |
| set i "$___fish_git_prompt_color_stagedstate$i$___fish_git_prompt_color_stagedstate_done" | |
| end | |
| if test -n "$s" | |
| set s "$___fish_git_prompt_color_stashstate$s$___fish_git_prompt_color_stashstate_done" | |
| end | |
| if test -n "$u" | |
| set u "$___fish_git_prompt_color_untrackedfiles$u$___fish_git_prompt_color_untrackedfiles_done" | |
| end |
fish-shell/share/functions/fish_git_prompt.fish
Lines 479 to 480 in f75cf5c
| # Formatting | |
| set -l f "$w$i$s$u" |
When $__fish_git_prompt_show_informative_status is set:
| set -g ___fish_git_prompt_status_order stagedstate invalidstate dirtystate untrackedfiles stashstate |
In the first case, the order is: dirty, staged OR invalid, stash, untracked
In the second case, the order is: staged, invalid, dirty, untracked, stash
I believe the second order is more logical, because git status displays: staged, invalid, dirty, untracked in this order, and then putting the stash state at the end is the only logical place.
Here’s an example of running git status in a repository:
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Changes to be committed:
modified: src/theme/default_theme.rs
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: src/info/filetype.rs
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: Cargo.lock
Untracked files:
(use "git add <file>..." to include in what will be committed)
centos7/
Note: when$__fish_git_prompt_show_informative_status is not set, I’m not able to get the __fish_git_prompt_char_invalidstate char to appear on the prompt.
fish 3.2.1