bash-git-prompt icon indicating copy to clipboard operation
bash-git-prompt copied to clipboard

GIT_PROMPT_FETCH_TIMEOUT seems to be ignored

Open ArtS opened this issue 9 years ago • 4 comments

Whenever I execute any command in the repository folder (ls, echo, cat, git log etc), bash-git-prompt kicks in with its stuff, even if it did its job 1 second ago.

Not sure if that has anything to do with the GIT_PROMPT_FETCH_TIMEOUT variable or the way it's treated by the script.

ArtS avatar Apr 15 '15 06:04 ArtS

The GIT_PROMPT_FETCH_TIMEOUT is only for triggering the git fetch for determining if the remote has changes. Everything else needs to be executed on every command, that is after all the purpose of the prompt: to show the current status of the repository after a command.

magicmonty avatar Apr 16 '15 10:04 magicmonty

Is that correct to assume that commands should execute fairly quickly then? On my machine in any repository it seems extremely sluggish whenever the prompt scripts kick in. Would you be able to advice where to start looking for a cause of this problem? Thanks!

On Thu, Apr 16, 2015 at 8:42 PM, Martin Gondermann <[email protected]

wrote:

The GIT_PROMPT_FETCH_TIMEOUT is only for triggering the git fetch for determining if the remote has changes. Everything else needs to be executed on every command, that is after all the purpose of the prompt: to show the current status of the repository after a command.

— Reply to this email directly or view it on GitHub https://github.com/magicmonty/bash-git-prompt/issues/125#issuecomment-93705105 .

Art 04 1639 4620

ArtS avatar Apr 16 '15 14:04 ArtS

Since bash is a scripting language, and I have to rely on tools like git for the output I'm somewhat restricted performancewise. If you have a very large Git repository (maybe with a deep folder hierarchy or many submodules) that takes long to parse there is currently no way to make it faster. The only thing you could do here, is to disable the prompt for the repository (see https://github.com/magicmonty/bash-git-prompt/issues/80#issuecomment-57519980 on this one). Otherwise I have no idea of your setup (hardware, OS, other bash plugins etc.), so I currently have no idea how to speed up the prompt otherwise.

magicmonty avatar Apr 16 '15 14:04 magicmonty

@ArtS What environment are you running in? (windows, mac, linux) What version of git are you using? Are you using a private git host, or colocated(github, gitlab, vsts)?

I suspect if it's painfully slow, you may be a fair (digital) distance from your upstream server. What's the ping time look like to your upstream host?

Also, there's a related issue to windows performance in particular, if that's where you are running.

tracker1 avatar Mar 22 '18 18:03 tracker1

Closing this due to lack of responses

guenhter avatar Oct 25 '22 16:10 guenhter