__git_ps1 extremely slow in kernel tree

前端 未结 6 1175
隐瞒了意图╮
隐瞒了意图╮ 2021-02-01 03:59
$ time __git_ps1
((v2.6.33.4))
real    0m1.467s
user    0m0.864s
sys  0m0.564s

It\'s making my prompt unusable; on the other hand, though, it\'s too us

6条回答
  •  温柔的废话
    2021-02-01 04:55

    It turned out to be a combination of two things:

    I was using

    export GIT_PS1_SHOWDIRTYSTATE=true
    export GIT_PS1_SHOWUNTRACKEDFILES=true
    

    by default. which proved to be unusable on a tree the size of the kernel. Removing these options removes a bit of nice functionality from __git_ps1, but at least it returns instantly now. (Useful lesson - try out stuff from a freshly created user account before anything else.)

    Also, the hard disk on my work machine is just plain slow, so that wasn't a git problem per se; it's just the first time it really obtruded itself upon my notice.

提交回复
热议问题