From: Oleg Broytman Date: Fri, 28 Aug 2020 23:30:14 +0000 (+0300) Subject: Feat(bash-prompt): Reorder signs: `*+$%` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a1df7fa8cc5301684ae8eb8bc2852a05531b7816;p=dotfiles.git Feat(bash-prompt): Reorder signs: `*+$%` Order signs the same way `__git_ps1` does. --- diff --git a/admin/prog/bash_prompt b/admin/prog/bash_prompt index f379668..e04e6e8 100644 --- a/admin/prog/bash_prompt +++ b/admin/prog/bash_prompt @@ -40,19 +40,14 @@ prompt_git() { # ensure index is up to date #git update-index --really-refresh -q &>/dev/null - # check for uncommitted changes in the index - if ! $(git diff --quiet --ignore-submodules --cached); then - s="$s+"; - fi - # check for unstaged changes if [ -n "$(git ls-files --modified)" ]; then s="$s*"; fi - # check for untracked files - if [ -n "$(git ls-files --others --exclude-standard)" ]; then - s="$s%"; + # check for uncommitted changes in the index + if ! $(git diff --quiet --ignore-submodules --cached); then + s="$s+"; fi # check for stashed files @@ -60,6 +55,11 @@ prompt_git() { s="$s$"; fi + # check for untracked files + if [ -n "$(git ls-files --others --exclude-standard)" ]; then + s="$s%"; + fi + fi # get the short symbolic ref