{"record":{"id":"e2dc3e1a81d771a6","repo":"sds/overcommit","slug":"unable-to-write-to-local-repo-git-config-result","errorCode":null,"errorMessage":"Unable to write to local repo git config: #{result.stderr}","messagePattern":"Unable to write to local repo git config: #(.+?)","errorType":"exception","errorClass":"Overcommit::Exceptions::GitConfigError","httpStatus":null,"severity":"error","filePath":"lib/overcommit/configuration.rb","lineNumber":245,"sourceCode":"\n      # We don't cast since we want to allow anything to count as \"true\" except\n      # a literal zero\n      result.stdout.strip != '0'\n    end\n\n    # Update the currently stored signature for this hook.\n    def update_signature!\n      result = Overcommit::Utils.execute(\n        %w[git config --local] + [signature_config_key, signature]\n      )\n\n      verify_signature_value = @hash['verify_signatures'] ? 1 : 0\n      result &&= Overcommit::Utils.execute(\n        %W[git config --local #{verify_signature_config_key} #{verify_signature_value}]\n      )\n\n      unless result.success?\n        raise Overcommit::Exceptions::GitConfigError,\n              \"Unable to write to local repo git config: #{result.stderr}\"\n      end\n    end\n\n    protected\n\n    attr_reader :hash\n\n    private\n\n    def ad_hoc_hook?(hook_context, hook_name)\n      ad_hoc_conf = @hash.fetch(hook_context.hook_class_name) { {} }.fetch(hook_name) { {} }\n\n      # Ad hoc hooks are neither built-in nor have a plugin file written but\n      # still have a `command` specified to be run\n      !built_in_hook?(hook_context, hook_name) &&\n        !plugin_hook?(hook_context, hook_name) &&\n        (ad_hoc_conf['command'] || ad_hoc_conf['required_executable'])","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/sds/overcommit/blob/fee0cd74b26eb81f64b43b7fab17bbb541575cc4/lib/overcommit/configuration.rb#L227-L263","documentation":"Error \"Unable to write to local repo git config: #{result.stderr}\" thrown in sds/overcommit.","triggerScenarios":"Thrown at lib/overcommit/configuration.rb:245 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure `.git/config` is writable by the current user (check file permissions and ownership).","Read the git stderr shown in the message for the specific failure (read-only filesystem, locked file, corrupt config).","Run `git config --local --list` manually to confirm local config access works outside Overcommit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fee0cd74b26eb81f64b43b7fab17bbb541575cc4","analyzedAt":"2026-08-23T04:07:28.153Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}