Function: magit-hash-range

magit-hash-range is a byte-compiled function defined in magit-git.el.

Signature

(magit-hash-range RANGE)

Documentation

Return a string with the revisions in RANGE replaced with commit oids.

Either side of RANGE may be omitted, and RANGE may be just a revision. If either revision cannot be dereferenced as a commit, signal an error.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-git.el
(defun magit-hash-range (range)
  "Return a string with the revisions in RANGE replaced with commit oids.
Either side of RANGE may be omitted, and RANGE may be just a revision.
If either revision cannot be dereferenced as a commit, signal an error."
  (if (string-match magit-range-re range)
      (magit-bind-match-strings (beg sep end) range
        (and (or beg end)
             (let ((beg-oid (and beg (magit-commit-oid beg)))
                   (end-oid (and end (magit-commit-oid end))))
               (and (or (not beg) beg-oid)
                    (or (not end) end-oid)
                    (concat beg-oid sep end-oid)))))
    (magit-commit-oid range)))