How to remove the shallow clone warning from HomeBrew

杀马特。学长 韩版系。学妹 提交于 2019-12-07 03:38:41

问题


➜  ~ brew info test 
Error: No available formula with the name "test" 
==> Searching for a previously deleted formula...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.

I have modified the git remote address to mirror address of homebrew before. Maybe it's relevant to this but I don't know.


回答1:


Just as what it says

To get complete history run:

git -C "$(brew --repo homebrew/core)" fetch --unshallow

This way brew info could search for formula that existed only in the past but removed at some point.

It might help in certain cases but probably not much. For example, the error could be caused by a typo in the formula name you're trying to lookup. In these cases I just ignore this error, rather than fetch all the history commits.




回答2:


I would advise against unshallowing the clone because it cramps disk space, makes the lookups slower and enables you only to install obsolete or unmaintaned applications.

There is currently no way to silence this warning. It was proposed in this Github issue but then ignored.

The function deleted_reason which prints the message contains a silent argument but afaik there is no way to use to use something like silent from the CLI commands which later call deleted_reason.



来源:https://stackoverflow.com/questions/45782694/how-to-remove-the-shallow-clone-warning-from-homebrew

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!