问题
➜ ~ 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