From 0355349b81612872f9e66cb0022ffe708d30a855 Mon Sep 17 00:00:00 2001 From: Lena Wildervanck Date: Fri, 19 May 2023 02:04:06 +0200 Subject: [PATCH] Add instruction on how to disable the monitor and switch to cmd_output_b --- pre_commit/staged_files_only.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pre_commit/staged_files_only.py b/pre_commit/staged_files_only.py index b26892b1..2c33abd7 100644 --- a/pre_commit/staged_files_only.py +++ b/pre_commit/staged_files_only.py @@ -53,12 +53,14 @@ def _unstaged_changes_cleared(patch_dir: str) -> Generator[None, None, None]: if ( (sys.platform == 'darwin' or sys.platform == 'win32') and os.path.exists('./.git/fsmonitor--daemon.ipc') and - cmd_output('git', 'fsmonitor--daemon', 'status')[0] == 0 + cmd_output_b('git', 'fsmonitor--daemon', 'status')[0] == 0 ): logger.warning( 'The fsmonitor daemon is running; ' 'a bug in the fsmonitor daemon sometimes causes data loss ' - 'when running with pre-commit.', + 'when running with pre-commit. ' + 'It’s possible to disable it by running ' + '`git config core.fsmonitor false`', ) tree = cmd_output('git', 'write-tree')[1].strip()