From 949d7e31b3076c386de90bbd14dc03c60b6cd23f Mon Sep 17 00:00:00 2001 From: "Aaron D. Marasco" Date: Tue, 12 Jan 2016 11:03:20 -0500 Subject: [PATCH 1/2] Ignore untracked files when deciding if dirty if GIT_PROMPT_IGNORE_UNTRACKED is set --- prompt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prompt.sh b/prompt.sh index 6a737b8..de15137 100644 --- a/prompt.sh +++ b/prompt.sh @@ -12,7 +12,7 @@ find_git_branch() { } find_git_dirty() { - local status=$(git status --porcelain 2> /dev/null) + local status=$(git status --porcelain ${GIT_PROMPT_IGNORE_UNTRACKED:+--untracked-files=no} 2> /dev/null) if [[ "$status" != "" ]]; then git_dirty='*' else From 1550344730e2b7aa254384ad6fa2b5991c0cc049 Mon Sep 17 00:00:00 2001 From: "Aaron D. Marasco" Date: Tue, 12 Jan 2016 11:05:17 -0500 Subject: [PATCH 2/2] Documentation --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 003dd7c..480441d 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,9 @@ this article: [How to: Change / Setup bash custom prompt (PS1)][how-to] [how-to]: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html +If you don't want untracked files to be included in the "dirty" decision process, +set the variable `GIT_PROMPT_IGNORE_UNTRACKED` to any value. + ### Suggested Prompts