Skip to content

Commit 80da228

Browse files
committed
fixup! fsmonitor: reintroduce core.useBuiltinFSMonitor
Under certain (not quite easy to force, apparently) circumstances, a Git process that just warned about the deprecated config setting will spawn another Git process that then _also_ warns about that config setting. Let's try to tone that down by setting an environment variable that indicates that this process and all of its children no longer need to tell the user about this deprecation. Note: This patch does not help in situations where, say, scripts call Git multiple times and each of those times Git prints this deprecation notice. It is unclear whether we can do anything about this because those Git processes would have to signal to their _parent_ process that the advice was already provided. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent c61dcf9 commit 80da228

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fsmonitor-settings.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ static int check_deprecated_builtin_config(struct repository *r)
5959
* the check resulted the config being set by this (deprecated) setting.
6060
*/
6161
if(!repo_config_get_bool(r, "core.useBuiltinFSMonitor", &core_use_builtin_fsmonitor)) {
62-
advise_if_enabled(ADVICE_USE_CORE_FSMONITOR_CONFIG,
63-
_("core.useBuiltinFSMonitor will be deprecated "
64-
"soon; use core.fsmonitor instead"));
62+
if (!git_env_bool("GIT_SUPPRESS_USEBUILTINFSMONITOR_ADVICE", 0)) {
63+
advise_if_enabled(ADVICE_USE_CORE_FSMONITOR_CONFIG,
64+
_("core.useBuiltinFSMonitor will be deprecated "
65+
"soon; use core.fsmonitor instead"));
66+
setenv("GIT_SUPPRESS_USEBUILTINFSMONITOR_ADVICE", "1", 1);
67+
}
6568
if (core_use_builtin_fsmonitor) {
6669
fsm_settings__set_ipc(r);
6770
return 1;

0 commit comments

Comments
 (0)