Function: vc-git-symbolic-commit

vc-git-symbolic-commit is a byte-compiled function defined in vc-git.el.gz.

Signature

(vc-git-symbolic-commit COMMIT &optional FORCE)

Documentation

Translate revision string of COMMIT to a symbolic form.

If the optional argument FORCE is non-nil, the returned value is allowed to include revision specifications like "master~8"
(the 8th parent of the commit currently pointed to by the master
branch), otherwise such revision specifications are rejected, and the function returns nil.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-git.el.gz
(defun vc-git-symbolic-commit (commit &optional force)
  "Translate revision string of COMMIT to a symbolic form.
If the optional argument FORCE is non-nil, the returned value is
allowed to include revision specifications like \"master~8\"
\(the 8th parent of the commit currently pointed to by the master
branch), otherwise such revision specifications are rejected, and
the function returns nil."
  (and commit
       (with-temp-buffer
         (and
          (vc-git--out-ok "name-rev" "--no-undefined" "--name-only" commit)
          (goto-char (point-min))
          (or force (not (looking-at "^.*[~^].*$" t)))
          (= (forward-line 2) 1)
          (bolp)
          (buffer-substring-no-properties (point-min)
                                          (1- (point-max)))))))