GitBash is generally slow

Since I installed GitBash on my computer, the prompt has been very unresponsive. I think I've dropped the culprit down to command __git_ps1

.

The timings for this command are as follows: along with the output:

$ time __git_ps1
+ __git_ps1
+ local pcmode=no
+ local detached=no
+ local 'ps1pc_start=\u@\h:\w '
+ local 'ps1pc_end=\$ '
+ local 'printf_format= (%s)'
+ case "$#" in
+ printf_format=' (%s)'
+ local ps1_expanded=yes
+ '[' -z '' ']'
+ '[' -z '3.1.20(4)-release' ']'
+ shopt -q promptvars
+ local repo_info rev_parse_exit_code
++ git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-
work-tree --short HEAD
+ repo_info=
+ rev_parse_exit_code=128
+ '[' -z '' ']'
+ '[' no = yes ']'
+ return

real    0m0.541s
user    0m0.000s
sys     0m0.358s

      

$ PS1 equals \[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[33m\]\w$(__git_ps1)\[\033[0m\]\n$

I don't have this problem on any of my other computers. I have virtualized windows 7 8.1 and 10 and they all don't have this issue. Any insight into this issue would be helpful

time git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD

on my computer:

real    0m0.364s
user    0m0.000s
sys     0m0.186s

      

Above commands in VM:

real    0m0.031s
user    0m0.000s
sys     0m0.015s

      

+3


source to share


1 answer


Check your Windows installation for any process trackers. These are corporate installed services / agents that track the launch of each process for compliance reasons. Example: Altiris. Work with your compliance team to get exceptions for git / bash / cygwin etc ... Get either exceptions or changes in how these processes are logged (asych vs. sync). Good luck if your firm uses them.



0


source







All Articles