Skip to content

Commit

Permalink
Added possibility to ignore a repository completely by adding "GIT_PR…
Browse files Browse the repository at this point in the history
…OMPT_IGNORE=1" to .bash-git-rc

Fixes #80
  • Loading branch information
magicmonty committed Oct 1, 2014
1 parent 9005bf4 commit fa1189b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # displays as ✘-1 fo
on a per repository basis by creating a file named ``.bash-git-rc`` with the
content ``FETCH_REMOTE_STATUS=0`` in the root of your git repository.

- You can also ignore a repository completely by creating a file named ``.bash-git-rc`` with the
content ``GIT_PROMPT_IGNORE=1`` in the root of your git repository.

- You can get help on the git prompt with the function ``git_prompt_help``.
Examples are available with ``git_prompt_examples``.
A list of all available named colors is available with `git_prompt_color_samples`
Expand Down
9 changes: 8 additions & 1 deletion gitprompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,18 @@ function setGitPrompt() {
FETCH_REMOTE_STATUS=0
fi

unset GIT_PROMPT_IGNORE

if [[ -e "$repo/.bash-git-rc" ]]; then
source "$repo/.bash-git-rc"
fi

if [ "$FETCH_REMOTE_STATUS" = 1 ]; then
if [[ "$GIT_PROMPT_IGNORE" = 1 ]]; then
PS1="$EMPTY_PROMPT"
return
fi

if [[ "$FETCH_REMOTE_STATUS" = 1 ]]; then
checkUpstream
fi

Expand Down

0 comments on commit fa1189b

Please sign in to comment.