Closed grensjo closed 7 years ago
Why not simply set BULLETTRAIN_GIT_SHOW
to false
? Or remove git
segment entirely? (see #188). Won't the effect be the same?
@dawikur Can the BULLETTRAIN_GIT_SHOW flag can be set on a specific directory?
@reaktivo Unfortunately not, it ~is~ was global setting (which was removed in #188). What is your use case?
Same use case as @grensjo, I have a few git repositories where I want to completely disable any git status checking since it takes around 4 seconds, but ideally would like to only disable it for this directories and not globally.
I'm not a big fan of having too different ways to configure a similar feature, but I see the value. I worked on a big git repo as well, and it took quite a while too show the prompt. I vote for merging that in.
I see the point of it. Setting it per-repo might be a useful feature. We should only add comment about it to README so it would not be a hidden feature.
What I don't like is that, for doing the same thing for, let's say, mercury, that would be a different process.
Well, this is a built-in oh-my-zsh feature, and right now Bullet Train is incompatible with it. If the "oh-my-zsh.hide-status" is set in a git repo, the git info is currently partially visible with Bullet Train, which is clearly not desirable behavior.
Bullet Train should either show the git info in its entirety, or do as oh-my-zsh itself and hide it if the flag is set. Since the latter option is consistent with how other themes behave, and since it is a nice feature, I think that is the better option.
I agree that it is not optimal that this only works for git, but since we're talking about a repo-level config it is probably difficult to make this more general in a good way. Either way, since the behavior is already partially there it makes sense to just fix this. If the feature is wanted for mercurial as well, I'm sure it's possible to do something similar there, but that is another issue.
👍 Still think it should be merged.
@grensjo Can you add documentation to README so I can merge your PR?
@caiogondim Done!
Currently, when handling large git repositories on weak machines, generating the prompt can be really slow. For most oh-my-zsh themes, a good workaround is to manually set the "oh-my-zsh.hide-status" git config flag, which causes the
git_prompt_info
function to do nothing.However, bullet-train does some extra work besides calling
git_prompt_info
. Therefore, setting this flag causes the git part of the prompt to be only partially hidden, and there is still an annoying delay. This should be fixed.I have tested this fix successfully on my machines, and the check is basically the same as in Oh My Zsh (see https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/git.zsh#L4).