Function: vc-git-mode-line-string
vc-git-mode-line-string is a byte-compiled function defined in
vc-git.el.gz.
Signature
(vc-git-mode-line-string FILE)
Documentation
Return a string for vc-mode-line to put in the mode line for FILE.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-git.el.gz
(defun vc-git-mode-line-string (file)
"Return a string for `vc-mode-line' to put in the mode line for FILE."
(pcase-let* ((backend-name "Git")
(state (vc-state file))
(`(,state-echo ,face ,indicator)
(vc-mode-line-state state))
(rev (vc-working-revision file 'Git))
(disp-rev (or (vc-git--symbolic-ref file)
(and rev (substring rev 0 7))))
(state-string (concat (unless (eq vc-display-status 'no-backend)
backend-name)
indicator disp-rev)))
(propertize state-string 'face face 'help-echo
(concat state-echo " under the " backend-name
" version control system"
"\nCurrent revision: " rev))))