gpt4 book ai didi

git status --ignored 无限期挂起

转载 作者:行者123 更新时间:2023-12-04 10:41:07 24 4
gpt4 key购买 nike

tl;博士 : 运行 git status --ignored在我的项目的根目录永远不会完成。 git status工作正常。

我开始从我的 IDE - PhpStorm 看到这个问题的症状(尽管这个问题适用于所有 IntelliJ IDE)。没有与 git 相关的操作(提交、推送、获取)工作,所有这些都会无休止地挂起。查看正在运行的进程,结果是 git进程占用 100% CPU。

杀死 git 进程使 IDE 再次顺利运行几分钟。似乎它会定期生成同步更改的过程。后来进行了一些实验,结果证明这不是 PhpStorm 的问题,而是 git 的问题。 . git status --ignored即使从命令行执行,也永远不会完成。

最佳答案

就我而言,罪魁祸首是项目路径中的深层目录结构。它一定是由我们工具堆栈中的某些东西生成的,我没有注意到,因为它有 100 多个目录深,那里没有实际文件。
cp拒绝复制这个目录,说name too long (not copied) .我猜 git不知何故在这样的目录上绊倒了。

删除深层嵌套的目录层次结构为我和 git status --ignored 解决了这个问题现在按预期工作。

编辑:这被确认是 git 中的一个错误.邮件列表摘录:

There is no such directory depth limit, but the runtime of 'git status --ignored' grows quickly with the depth of the untracked directory. Running this shell loop produces the numbers below:

10: 0.01
11: 0.03
12: 0.05
13: 0.11
14: 0.23
15: 0.47
16: 0.97
17: 1.97
18: 3.88
19: 7.85
20: 16.29
21: 32.92
22: 76.24

Beautifully quadratic, isn't it? :)

Unless I messed up my numbers, with a depth of 120 directories it would take over 6*10^23 years to complete... so yeah, it does qualify as indefinitely.

关于git status --ignored 无限期挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59928800/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com