Commit 0b86dbfd authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-repo-list-column-version: Show when repo is dirty

parent ae12c20c
* Magit v2.91.0 Release Notes (unreleased)
** Breaking changes
** Changes since v2.90.0
- The "Version" column in ~magit-submodule-list-mode~ and
~magit-repolist-mode~ buffers now shows when a repository is dirty.
** Fixes since v2.90.0
- Staging and unstaging submodules while ~diff.submodule~'s value is ~log~
......
......@@ -179,11 +179,13 @@ Usually this is just its basename."
(defun magit-repolist-column-version (_id)
"Insert a description of the repository's `HEAD' revision."
(let ((v (or (magit-git-string "describe" "--tags")
(let ((v (or (magit-git-string "describe" "--tags" "--dirty")
;; If there are no tags, use the date in MELPA format.
(magit-git-string "show" "--no-patch" "--format=%cd-g%h"
"--date=format:%Y%m%d.%H%M"))))
(save-match-data
(when (string-match "-dirty\\'" v)
(put-text-property (1+ (match-beginning 0)) (length v) 'face 'error v))
(if (and v (string-match "\\`[0-9]" v))
(concat " " v)
v))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment