Commit 469849c3 authored by Patrick Steinhardt's avatar Patrick Steinhardt

system_check: Remove Git configuration check

Back when Git was still invoked by Rails we had to make sure that the
Git configuration had certain options set. One of those options was
"core.autocrlf", which was required such that no conversion of line
endings is performed when reading blobs from the repository.

Nowadays this configuration isn't required by Rails anymore: it is not
in the business of reading blobs anymore. This is now the responsibility
of Gitaly, which knows to set this option globally such that all spawned
Git commands won't ever convert line endings.

Remove the system check which checked for this option. Furthermore,
update our install instructions such that we don't ask admins to set
this config entry anymore.

Changelog: removed
parent 2fa14ee0
......@@ -560,10 +560,6 @@ sudo -u git -H cp config/puma.rb.example config/puma.rb
# cores you have available. You can get that number via the `nproc` command.
sudo -u git -H editor config/puma.rb
# Configure Git global settings for git user
# 'autocrlf' is needed for the web editor
sudo -u git -H git config --global core.autocrlf input
# Disable 'git gc --auto' because GitLab already runs 'git gc' when needed
sudo -u git -H git config --global gc.auto 0
......
# frozen_string_literal: true
module SystemCheck
module App
class GitConfigCheck < SystemCheck::BaseCheck
OPTIONS = {
'core.autocrlf' => 'input'
}.freeze
set_name 'Git configured correctly?'
def check?
correct_options = OPTIONS.map do |name, value|
run_command(%W(#{Gitlab.config.git.bin_path} config --global --get #{name})).try(:squish) == value
end
correct_options.all?
end
# Tries to configure git itself
#
# Returns true if all subcommands were successful (according to their exit code)
# Returns false if any or all subcommands failed.
def repair!
return false unless gitlab_user?
command_success = OPTIONS.map do |name, value|
system(*%W(#{Gitlab.config.git.bin_path} config --global #{name} #{value}))
end
command_success.all?
end
def show_error
try_fixing_it(
sudo_gitlab("\"#{Gitlab.config.git.bin_path}\" config --global core.autocrlf \"#{OPTIONS['core.autocrlf']}\"")
)
for_more_information(
see_installation_guide_section('GitLab')
)
end
end
end
end
......@@ -12,7 +12,6 @@ module SystemCheck
def self.checks
[
SystemCheck::App::GitConfigCheck,
SystemCheck::App::DatabaseConfigExistsCheck,
SystemCheck::App::MigrationsAreUpCheck,
SystemCheck::App::OrphanedGroupMembersCheck,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment