{"record":{"id":"99467be59db68fd6","repo":"sds/overcommit","slug":"unable-to-check-if-commits-on-the-remote-ref-will","errorCode":null,"errorMessage":"Unable to check if commits on the remote ref will be overwritten: #{result.stderr}","messagePattern":"Unable to check if commits on the remote ref will be overwritten: #(.+?)","errorType":"exception","errorClass":"Overcommit::Exceptions::GitRevListError","httpStatus":null,"severity":"error","filePath":"lib/overcommit/hook_context/pre_push.rb","lineNumber":84,"sourceCode":"\n      def to_s\n        \"#{local_ref} #{local_sha1} #{remote_ref} #{remote_sha1}\"\n      end\n\n      private\n\n      def ref_range\n        \"#{remote_sha1}..#{local_sha1}\"\n      end\n\n      def overwritten_commits\n        return @overwritten_commits if defined? @overwritten_commits\n\n        result = Overcommit::Subprocess.spawn(%W[git rev-list #{remote_sha1} ^#{local_sha1}])\n        if result.success?\n          result.stdout.split(\"\\n\")\n        else\n          raise Overcommit::Exceptions::GitRevListError,\n                \"Unable to check if commits on the remote ref will be overwritten: #{result.stderr}\"\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":66,"sourceCodeEnd":91,"githubUrl":"https://github.com/sds/overcommit/blob/fee0cd74b26eb81f64b43b7fab17bbb541575cc4/lib/overcommit/hook_context/pre_push.rb#L66-L91","documentation":"Error \"Unable to check if commits on the remote ref will be overwritten: #{result.stderr}\" thrown in sds/overcommit.","triggerScenarios":"Thrown at lib/overcommit/hook_context/pre_push.rb:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the git stderr shown in the message for the exact failure (missing ref, auth error, network problem) and fix it.","Fetch the remote ref first (`git fetch <remote>`) so `git rev-list` can compare the local and remote commits locally.","Check network connectivity and credentials to the remote, then retry the push."],"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"}