git bash auto complete slow on windows 7 x64

前端 未结 3 1626
故里飘歌
故里飘歌 2021-01-02 02:43

I have two machines where git bash auto complete is agonizingly slow. When I hit tab, it can take 8 to 10 seconds for the filename to be completed. This only seems to happen

相关标签:
3条回答
  • 2021-01-02 02:53

    Git 2.13 (Q2 2017) should improve Git bash completion, because the refs completion for large number of refs has been sped up, partly by giving up disambiguating ambiguous refs and partly by eliminating most of the shell processing between 'git for-each-ref' and 'ls-remote' and Bash's completion facility.

    See commit 227307a, commit 745d655, commit fef56eb, commit 400a755, commit 824388d, commit e8cb023, commit e896369, commit b2b6811, commit 3ad8ea7, commit aed3881, commit aa0644f, commit 2ea328a, commit 15b4a16 (23 Mar 2017), and commit c977eef (03 Feb 2017) by SZEDER Gábor (szeder).
    (Merged by Junio C Hamano -- gitster -- in commit bf65060, 30 Mar 2017)

    For example:

    completion: speed up branch and tag completion

    Modify __git_heads() and __git_tags() and the few callsites they have, so we can let 'git for-each-ref' do all the hard work and these functions' output won't need any further processing or filtering before being handed over to Bash, resulting in faster branch and tag completion. These are some of the same tricks used in the previous commits to speed up refs completion, namely:

    • Extend both functions to accept prefix, current word and suffix positional parameters, all optional and all empty by default to keep the parameterless behavior unaltered.

    • Specify appropriate globbing patterns to 'git for-each-ref' to list only branches or tags matching the given current word parameter.

    • Modify the 'git for-each-ref --format=<...>' to include the given prefix and suffix.

    • Adjust all callsites to specify the proper prefix, current word and suffix parameters, and to fill COMPREPLY using __gitcomp_direct().


    Note: the performance of filename completion improves with Git 2.18 (Q2 2018): see "Git bash-completion with filename support?"

    0 讨论(0)
  • 2021-01-02 03:00

    This is a known issue with the stable version of ConEmu.

    From the ConEmu page:

    Disclaimer #2

    If you notice lags while executing batches or commands (from cmd/git/bash/etc.) just upgrade to latest alpha build or uncheck option "Inject ConEmuHk". Read Issue 526 for details.

    0 讨论(0)
  • 2021-01-02 03:02

    I was still having an issue with slow autocomplete for git commands only, using version 1.9.5. Autocompleting at the root level could take 8 seconds, though it was faster at lower levels with fewer files.

    I finally fixed the issue with information found here: https://github.com/msysgit/msysgit/wiki/Diagnosing-why-Git-is-so-slow

    By setting git config core.fscache true for my repository, the autocomplete runs faster for many commands, like add and diff, though not all, such as rm. I hope that helps.

    0 讨论(0)
提交回复
热议问题