Skip to content

Commit

Permalink
Hide git prompt completely if git config flag "oh-my-zsh.hide-status"…
Browse files Browse the repository at this point in the history
… is set (#184)

* Hide git prompt if git config flag "oh-my-zsh.hide-status" is set

* Add documentation about the `oh-my-zsh.hide-status` git config flag
  • Loading branch information
grensjo authored and caiogondim committed Mar 9, 2017
1 parent 246aa80 commit 09b5d89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ NOTE: You do not need to specify *end* segment - it will be added automatically.
|`BULLETTRAIN_GIT_BEHIND`|`" ⬇"`|Icon for behind state from remote
|`BULLETTRAIN_GIT_DIVERGED`|`" ⬍"`|Icon for diverged state from remote

The git prompt can be disabled for a specific repository by setting a git config flag: `get config oh-my-zsh.hide-status 1`. This is useful to avoid performance issues for particularly huge repositories.

### Mercurial/HG

|Variable|Default|Meaning
Expand Down
4 changes: 4 additions & 0 deletions bullet-train.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ prompt_custom() {

# Git
prompt_git() {
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" == "1" ]]; then
return
fi

local ref dirty mode repo_path git_prompt
repo_path=$(git rev-parse --git-dir 2>/dev/null)

Expand Down

0 comments on commit 09b5d89

Please sign in to comment.