Недавно я установил git version 2.36.0.windows.1
и после клонирования репозитория получил следующие сообщения.
hint: core.useBuiltinFSMonitor will be deprecated soon; use core.fsmonitor instead
hint: Disable this message with "git config advice.useCoreFSMonitorConfig false"
Изменение значения на false
отключает сообщение.
Мои вопросы:
core.useBuiltinFSMonitor
и core.fsmonitor
?Спасибо!
Редактировать:
Спасибо @Chris за объяснение и ссылки, чтобы осмотреться.
TL;DR
Можно смело использовать команду git config --global core.fsmonitor true
, чтобы избавиться от сообщения навсегда.
Ответ на то, что в ответе Криса и почему, ниже.
The new FSMonitor feature is controlled by the core.useBuiltinFSMonitor boolean. Link
So I understand that the builtin FS monitor is not actually deprecated, just that the name in the config is going to change, is there, on the current version, any way to use the new name or is the only way to get rid of the message to disable it via the provided command?
I guess we should clarify by saying core.useBuiltinFSMonitor=true was experimental, please set core.fsmonitor=true` instead. Link
With the feature going upstream into core Git, a decision was made to overload the existing core.fsmonitor setting to take a hook-pathname or a boolean value for the builtin FSMonitor. However, users may have multiple versions of Git installed on their systems on Windows. One in the C:/program files/... and hidden versions installed by tools like Visual Studio. And these may be at different revision levels, so one install might only understand the old keyword and one version might understand both (during the transition). So, auto transitioning it would break whichever one is the older release. So it's safer to just warn the user and let them decide. (And if they know they have multiple versions, they can just set both for now.) Link
примечания к выпуску Git для Windows 2.30.2 (март 2021 г.) дает некоторые подсказки:
Git for Windows now ships with an experimental built-in file-system monitor, without the need to install Watchman and setting
core.fsmonitor
. It can be turned on by setting bothfeature.manyFiles=true
andfeature.experimental=true
(or directly, viacore.useBuiltinFSMonitor=true
).
core.useBuiltinFSMonitor
не задокументирован в веб-сайт Git, даже в старая версия, где она должна существовать, но, похоже, это был параметр, позволяющий включить встроенный монитор файловой системы для пользователей, которые хотят жить на переднем крае.
Подсказки, которые вы цитируете в своем вопросе, предполагают, что эта функция теперь считается достаточно стабильной, чтобы использоваться по умолчанию. Действительно, если мы посмотрим на документация для core.fsmonitor
, то увидим, что дело обстоит именно так¹:
If set to true, enable the built-in file system monitor daemon for this working directory
(старая документация показывает, что этот параметр существовал до этого изменения, но он использовался для указания на внешнюю команду для использования в качестве монитора.)
В документации также объясняется, почему нам может понадобиться монитор файловой системы в первую очередь и почему предпочтительнее встроенный монитор:
Like hook-based file system monitors, the built-in file system monitor can speed up Git commands that need to refresh the Git index (e.g.
git status
) in a working directory with many files. The built-in monitor eliminates the need to install and maintain an external third-party tool.
Что касается того, почему вы получаете это предупреждение при клонировании, я не уверен. У вас уже есть глобальный файл .gitconfig
в вашем домашнем каталоге? Возможно, тот, который ваш работодатель поставляет как часть конфигурации по умолчанию?
¹На момент написания документа эта функция была доступна только в Windows и macOS.
Итак, раньше у меня не было глобального
.gitconfig
в моем каталоге. Я все же нашел ответы. Это слишком долго, чтобы добавить сюда, поэтому я отредактирую его в своем ответе.