混帐bash自动完成缓慢的Windows 7 x64 [英] git bash auto complete slow on windows 7 x64

查看:122
本文介绍了混帐bash自动完成缓慢的Windows 7 x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两台机器,git bash自动完成的速度非常慢。当我点击标签时,可能需要8到10秒才能完成文件名。这似乎只在auto complete是 git 命令的一部分时才会发生。自动完成 cd 工作正常。 git命令的实际执行运行良好。



我使用 git version 1.8.3-preview20130601

  $ git count-objects -vH 
count:9
size:10.23 KiB
in-pack:2488
packs:1
size-pack:18.68 MiB
prune-packable:0
垃圾:0
size-garbage:0字节

有什么可能导致这种情况?是否有任何可能的修复?



编辑:我更新到 Git(版本1.8.4-preview20130916)和问题依然存在。我注意到,在ConEmu中运行bash shell时,长暂停期间显示在底部的命令是 uniq.exe 。看起来对该可执行文件的调用是咀嚼时间。



编辑:更新到 git version 1.9.0.msysgit.0 缓解了很多问题。延迟现在只有1到2秒。其他命令(如 cd )仍然几乎是即时(<0.5s)。我也没有看到 uniq.exe 运行,只是 sh.exe


Git 2.13(2017年第2季度)应该会改进Git bash的完成,因为大量refs的refs已经加速,部分是通过放弃歧义refs来消除歧义部分原因是消除了'git for-each-ref'和'ls-remote'与Bash的完成工具之间的大部分shell处理。

请参阅 commit 227307a commit 745d655 commit fef56eb 提交400a755 commit 824388d 提交e8cb023 提交e896369 < a>, commit b2b6811 commit 3ad8ea7 commit aed3881 commit aa0644f 提交2ea328a 提交15b4a16 (23 2017年3月)和提交c977eef (2017年2月3日) SZEDERGábor( szeder

(由 Junio C Hamano - gitster - 合并在提交bf65060 ,2017年3月30日)



例如:


完成:速度修改 __ git_heads() __ git_tags()修改分支和标签完成



c $ c>和他们有的几个电话,
,所以我们可以让' git for-each-ref '完成所有的辛苦工作,这些
函数的输出将不需要任何进一步处理或过滤
被移交给Bash,导致更快的分支并标记
完成。这些是前面
提交中用于加速refs完成的一些技巧,即:


  • 扩展这两个函数接受前缀,当前字和后缀
    位置参数,所有可选项和默认全部为空
    保持参数行为不变。



  • 指定适当的匹配模式为' git for-each-ref '仅列出与给定当前字
    匹配的分支或标签。

  • 修改' git for-each-ref --format =< ...> '以包含给定的
    前缀和后缀。 调整所有调用以指定正确的前缀,当前字
    和后缀参数,并使用
    __ gitcomp_direct()填充 COMPREPLY




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 when the auto complete is part of a git command. Auto complete for cd works fine. The actual execution of the git command runs fine.

I am using git version 1.8.3-preview20130601

$ git count-objects -vH
count: 9
size: 10.23 KiB
in-pack: 2488
packs: 1
size-pack: 18.68 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

What could be causing this? Is there any possible fix?

EDIT: I updated to Git (version 1.8.4-preview20130916) and the problem still persists. I did notice that when running the bash shell in ConEmu the command displayed at the bottom during the long pause is uniq.exe. It seems that the call to that executable is what is chewing up the time.

EDIT: Updating to git version 1.9.0.msysgit.0 has alleviated much of the problem. The delay is now only 1 to 2 seconds. Other commands like cd are still almost instant (< 0.5s). I also do not see uniq.exe running anymore, just sh.exe.

解决方案

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().

这篇关于混帐bash自动完成缓慢的Windows 7 x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆