Refactor functions and update documentation

Add new variable to enable/disable git prompt minimal status information
and consolidate functions for code re-use. Also update README
documentation to capture the usage of new variable.
This commit is contained in:
Ivan Font
2017-01-04 15:48:32 -08:00
parent a068e3b66e
commit 1d55249181
2 changed files with 32 additions and 15 deletions

View File

@@ -200,6 +200,8 @@ Set `SCM_GIT_SHOW_DETAILS` to 'false' to **don't show** it:
* `export SCM_GIT_SHOW_DETAILS=false`
**NOTE:** If using `SCM_GIT_SHOW_MINIMAL_INFO=true`, then the value of `SCM_GIT_SHOW_DETAILS` is ignored.
#### Remotes and remote branches
In some git workflows you must work with various remotes, for this reason, Bash-it can provide some useful information about your remotes and your remote branches, for example, the remote on you are working, or if your local branch is tracking a remote branch.
@@ -218,6 +220,8 @@ Set `SCM_GIT_SHOW_REMOTE_INFO` to 'false' to **disable the feature**:
* `export SCM_GIT_SHOW_REMOTE_INFO=false`
**NOTE:** If using `SCM_GIT_SHOW_MINIMAL_INFO=true`, then the value of `SCM_GIT_SHOW_REMOTE_INFO` is ignored.
#### Untracked files
By default, `git status` command shows information about *untracked* files, this behavior can be controlled through command line flags or git configuration files, for big repositories, ignoring *untracked* files can make git faster. Bash-it uses `git status` to gather the repo information it shows in the prompt, so in some circumstances, can be useful to instruct Bash-it to ignore these files. You can control this behavior with the flag `SCM_GIT_IGNORE_UNTRACKED`:
@@ -250,6 +254,16 @@ And
* `export SCM_THEME_CURRENT_USER_SUFFIX=' '``
**NOTE:** If using `SCM_GIT_SHOW_MINIMAL_INFO=true`, then the value of `SCM_GIT_SHOW_CURRENT_USER` is ignored.
#### Git show minimal status info
To speed up the prompt while still getting minimal git status information displayed such as the value of HEAD and whether there are any dirty objects, you can set:
```
export SCM_GIT_SHOW_MINIMAL_INFO=true
```
#### Ignore repo status
When working in repos with a large code base Bash-it can slow down your prompt when checking the repo status, to avoid it, there is an option you can set via Git config to disable checking repo status in Bash-it.