Function: magit-repolist-column-version

magit-repolist-column-version is a byte-compiled function defined in magit-repos.el.

Signature

(magit-repolist-column-version _)

Documentation

Insert a description of the repository's HEAD revision.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20261101.2154/magit-repos.el
(defun magit-repolist-column-version (_)
  "Insert a description of the repository's `HEAD' revision."
  (cond-let
    ([v (magit-git-string "describe" "--tags" "--dirty")]
     (save-match-data
       (when (string-match magit-repolist-column-version-regexp v)
         (magit--put-face (match-beginning 0) (match-end 0) 'shadow v)
         (when (match-end 2)
           (magit--put-face (match-beginning 2) (match-end 2) 'bold v))
         (when (match-end 4)
           (magit--put-face (or (match-beginning 3) (match-beginning 4))
                            (match-end 4) 'error v)))
       (when (string-match-p "\\`[0-9]" v)
         (setq v (concat " " v)))
       v))
    ([v (magit-rev-format "#%cd-g%h" nil "--date=format:%Y%m%d")]
     (magit--put-face 0 (length v) 'shadow v)
     (when (magit-anything-modified-p)
       (setq v (concat v "-dirty"))
       (magit--put-face 9 (length v) 'error v))
     v)))