Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve diagnostic for Git fsmonitor settings in Homebrew repository: #17794

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Library/Homebrew/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,26 @@
examine_git_origin(repo, Homebrew::EnvConfig.brew_git_remote)
end

def check_git_fsmonitor_settings
return unless Utils::Git.available?

fsmonitor = HOMEBREW_REPOSITORY.cd { `git config --get core.fsmonitor`.chomp }

Check warning on line 526 in Library/Homebrew/diagnostic.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/diagnostic.rb#L526

Added line #L526 was not covered by tests
return if fsmonitor != "true"

<<~EOS

Check warning on line 529 in Library/Homebrew/diagnostic.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/diagnostic.rb#L529

Added line #L529 was not covered by tests
Suspicious Git fsmonitor settings found.

The detected Git fsmonitor settings could interfere with Homebrew operations:
core.fsmonitor = #{fsmonitor}

This setting might block the lock file during a `brew upgrade` operation,
leading to potential issues and interruptions.

If you encounter problems, consider disabling fsmonitor in the Homebrew repository by running:
cd #{HOMEBREW_REPOSITORY} && git config core.fsmonitor false
EOS
end

def check_coretap_integrity
core_tap = CoreTap.instance
unless core_tap.installed?
Expand Down