sds/overcommit · error · Overcommit::Exceptions::GitRevListError

Unable to check if commits on the remote ref will be overwri

Error message

Unable to check if commits on the remote ref will be overwritten: #{result.stderr}

What it means

Error "Unable to check if commits on the remote ref will be overwritten: #{result.stderr}" thrown in sds/overcommit.

Source

Thrown at lib/overcommit/hook_context/pre_push.rb:84

      def to_s
        "#{local_ref} #{local_sha1} #{remote_ref} #{remote_sha1}"
      end

      private

      def ref_range
        "#{remote_sha1}..#{local_sha1}"
      end

      def overwritten_commits
        return @overwritten_commits if defined? @overwritten_commits

        result = Overcommit::Subprocess.spawn(%W[git rev-list #{remote_sha1} ^#{local_sha1}])
        if result.success?
          result.stdout.split("\n")
        else
          raise Overcommit::Exceptions::GitRevListError,
                "Unable to check if commits on the remote ref will be overwritten: #{result.stderr}"
        end
      end
    end
  end
end

View on GitHub (pinned to fee0cd74b2)

Solutions

  1. Read the git stderr shown in the message for the exact failure (missing ref, auth error, network problem) and fix it.
  2. Fetch the remote ref first (`git fetch <remote>`) so `git rev-list` can compare the local and remote commits locally.
  3. Check network connectivity and credentials to the remote, then retry the push.

When it happens

Trigger: Thrown at lib/overcommit/hook_context/pre_push.rb:84 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sds/overcommit@fee0cd74b2 (2026-08-23). Data as JSON: /api/errors/99467be59db68fd6. Report an issue: GitHub.