jimeh / git-aware-prompt

Display current Git branch name in your terminal prompt when in a Git working directory.
Creative Commons Zero v1.0 Universal
2.15k stars 340 forks source link

Allowing local disabling of git-aware-prompt #59

Open davefx opened 6 years ago

davefx commented 6 years ago

Through the variable DISABLE_GIT_AWARE, allow disabling the software. This is needed, for example, when using a huge git repository, if we don't want the script to slow the command line work

AaronDMarasco-VSI commented 6 years ago

Instead of a variable that disables all repos in your current shell, another option is to have something in your local clone that you know is problematic. A quick example showing that git is perfectly happy storing whatever you want in its config files:

$ git config ext.git-aware-prompt.disable 1
$ git config -l | grep aware
ext.git-aware-prompt.disable=1
$ grep -A1 aware ../../../.git/config 
[ext "git-aware-prompt"]
        disable = 1
$ git config --get --bool ext.git-aware-prompt.disable
true

This would change the bash script a little more, but I think it would be much more "git-like."