如何跳过“松散对象"运行“git gui"时弹出 [英] How to skip "Loose Object" popup when running 'git gui'

查看:33
本文介绍了如何跳过“松散对象"运行“git gui"时弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行git gui"时,我得到一个弹出窗口,上面写着

<上一页>该存储库当前大约有 1500 个松散对象.

然后它建议压缩数据库.我以前做过这个,它将松散的对象减少到大约 250 个,但这并没有抑制弹出窗口.再次压缩不会改变松散对象的数量.

当我们从 Perforce 过渡时,我们当前的工作流程需要大量使用rebase",而 Perforce 仍然是规范的 SCM.一旦 Git 成为规范的 SCM,我们将进行定期合并,并且应该大大缓解松散对象问题.

与此同时,我真的很想让这个有用的"弹出窗口消失.

解决方案

由于没有人给出答案,我查看了代码以了解如何删除显示该对话框的代码.我找到了执行此操作的 hint_gc 过程以及调用它的位置.同时我注意到 2011 年末添加了 一个用于禁用对话框的配置选项.此更改(git-gui 0.16.0 的一部分)已在 2011-12-14 合并到 Git 的主线.

因此,如果您使用 Git v1.7.9 或更高版本,您可以使用以下命令禁用警告对话框:

git config --global gui.gcwarning false

如果您使用的是旧版本,则可以编辑 /lib/git-core/git-gui 并删除 after 1000 hint_gc 行,或编辑 /usr/share/git-gui/lib/database.tcl 并删除 hint_gc 过程的主体.(这些文件路径在 Cygwin 上 - 在其他环境中,文件可能位于不同的位置.对于 Windows,它是 c:Program FilesGitmingw64libexecgit-coregit-gui.tcl)

When I run 'git gui' I get a popup that says

This repository currently has approximately 1500 loose objects.

It then suggests compressing the database. I've done this before, and it reduces the loose objects to about 250, but that doesn't suppress the popup. Compressing again doesn't change the number of loose objects.

Our current workflow requires significant use of 'rebase' as we are transitioning from Perforce, and Perforce is still the canonical SCM. Once Git is the canonical SCM, we will do regular merges, and the loose objects problem should be greatly mitigated.

In the mean time, I'd really like to make this 'helpful' popup go away.

解决方案

Since nobody had yet an answer, I looked into the code to see how to remove the code which shows up that dialog. I found the hint_gc procedure which does it and the place where it is called. At the same time I noticed that late 2011 there was added a configuration option for disabling the dialog. This change (part of git-gui 0.16.0) was merged to Git's mainline on 2011-12-14.

So if you use Git v1.7.9 or newer, you can disable the warning dialog with the following command:

git config --global gui.gcwarning false

If you are using an older version, then you can edit /lib/git-core/git-gui and remove the after 1000 hint_gc line, or edit /usr/share/git-gui/lib/database.tcl and remove the body of the hint_gc procedure. (These file paths are on Cygwin - on other environments the files might be in a different locations. For Windows it is c:Program FilesGitmingw64libexecgit-coregit-gui.tcl)

这篇关于如何跳过“松散对象"运行“git gui"时弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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