fix #25 - oh-my-git can be disabled on a per-repository basis (idea by Olaf Alders)

This commit is contained in:
Arialdo Martini 2014-05-28 09:05:03 +02:00
parent 630476f8ae
commit a126690cb0
3 changed files with 16 additions and 0 deletions

View File

@ -90,6 +90,15 @@ which are optional, but very cool.
Then, restart zsh. Then, restart zsh.
antigen will download and install all that's needed. antigen will download and install all that's needed.
# Disabling oh-my-git
oh-my-git can be disabled on a per-repository basis. Just add a
[oh-my-git]
enabled = true
in the `.git/config` file of a repo to revert to the original prompt for that particular repo. This could be handy when working with very huge repository, when the git commands invoked by oh-my-git can slow down the prompt.
# Known bugs and limitations # Known bugs and limitations
* git v1.8.4 or newer is required * git v1.8.4 or newer is required

View File

@ -12,6 +12,12 @@ function enrich {
} }
function build_prompt { function build_prompt {
enabled=`git config --local --get oh-my-git.enabled`
if [[ ${enabled} == false ]]; then
echo "${PSORG}"
exit;
fi
PS1="" PS1=""
# Git info # Git info
current_commit_hash=$(git rev-parse HEAD 2> /dev/null) current_commit_hash=$(git rev-parse HEAD 2> /dev/null)

View File

@ -1,3 +1,4 @@
PSORG=$PS1;
if [ -n "${BASH_VERSION}" ]; then if [ -n "${BASH_VERSION}" ]; then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"