Skip to content

Commit

Permalink
Merge pull request #3783: fixup! fsmonitor: reintroduce core.useBuilt…
Browse files Browse the repository at this point in the history
…inFSMonitor

This change to warn about core.useBuiltinFSMonitor is a good one, but it
is too aggressive. If a user has set core.useBuiltinFSMonitor=false,
then that warning shows up.

Perhaps there is value in warning users that their explicit disabling of
the feature will stop working. However, VFS for Git does this
assignment, so all users on those enlistments will start getting
warnings after upgrading Git. This situation is probably much more
likely than a typical user disabling the experimental feature
themselves.

Putting in this fix is easier than rereleasing VFS for Git.
  • Loading branch information
derrickstolee authored Apr 11, 2022
2 parents 48a6fa9 + 0231a90 commit 00388b6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fsmonitor-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,24 @@ static int check_for_incompatible(struct repository *r)

static int check_deprecated_builtin_config(struct repository *r)
{
int core_use_builtin_fsmonitor;
int core_use_builtin_fsmonitor = 0;

/*
* If 'core.useBuiltinFSMonitor' is set, print a deprecation warning
* suggesting the use of 'core.fsmonitor' instead. If the config is
* set to true, set the appropriate mode and return 1 indicating that
* the check resulted the config being set by this (deprecated) setting.
*/
if(!repo_config_get_bool(r, "core.useBuiltinFSMonitor", &core_use_builtin_fsmonitor)) {
if(!repo_config_get_bool(r, "core.useBuiltinFSMonitor", &core_use_builtin_fsmonitor) &&
core_use_builtin_fsmonitor) {
if (!git_env_bool("GIT_SUPPRESS_USEBUILTINFSMONITOR_ADVICE", 0)) {
advise_if_enabled(ADVICE_USE_CORE_FSMONITOR_CONFIG,
_("core.useBuiltinFSMonitor will be deprecated "
"soon; use core.fsmonitor instead"));
setenv("GIT_SUPPRESS_USEBUILTINFSMONITOR_ADVICE", "1", 1);
}
if (core_use_builtin_fsmonitor) {
fsm_settings__set_ipc(r);
return 1;
}
fsm_settings__set_ipc(r);
return 1;
}

return 0;
Expand Down

0 comments on commit 00388b6

Please sign in to comment.