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."
  (let* ((rev (vc-working-revision file 'Git))
         (disp-rev (or (vc-git--symbolic-ref file)
                       (and rev (substring rev 0 7))))
         (def-ml (vc-default-mode-line-string 'Git file))
         (help-echo (get-text-property 0 'help-echo def-ml))
         (face   (get-text-property 0 'face def-ml)))
    (propertize (concat (substring def-ml 0 4) disp-rev)
                'face face
                'help-echo (concat help-echo "\nCurrent revision: " rev))))