From 485ee5f707c1ce4cc3f0a910cd5b5ad5372d979c Mon Sep 17 00:00:00 2001 From: Aaron Salvo Date: Mon, 13 Oct 2014 13:07:50 -0400 Subject: [PATCH 1/2] Made it so people can use an env var (dirtysymb) to set a custom dirty symbol. --- prompt.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prompt.sh b/prompt.sh index 6a737b8..2ac3650 100644 --- a/prompt.sh +++ b/prompt.sh @@ -1,3 +1,7 @@ +# Users can set the dirtysymb env var in their .bash_profile, etc, +# or they can leave it unset and it will default to the '*'. +export dirtysymb=${dirtysymb:="*"}; + find_git_branch() { # Based on: http://stackoverflow.com/a/13003854/170413 local branch @@ -14,7 +18,7 @@ find_git_branch() { find_git_dirty() { local status=$(git status --porcelain 2> /dev/null) if [[ "$status" != "" ]]; then - git_dirty='*' + git_dirty=$dirtysymb else git_dirty='' fi From ee3afe3191c952e0ec7a163930a70b71da4c74e6 Mon Sep 17 00:00:00 2001 From: Aaron Salvo Date: Thu, 13 Oct 2016 11:41:18 -0400 Subject: [PATCH 2/2] Added info about how to set a custom dirty symbol. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 936ca9d..e7ad48c 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ your `PS1` variable, and make sure the variable value is defined with double quotes. A set of color variables have also been set for you to use. For a list of available colors check `colors.sh`. +If you would like to use a symbol other than '*' to indicate that the branch is +dirty, simply set the `dirtysmb` to whatever symbol you would like and export it. ## Updating