Codebase list magit / 0b86dbf
magit-repo-list-column-version: Show when repo is dirty Jonas Bernoulli 5 years ago
2 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
00 * Magit v2.91.0 Release Notes (unreleased)
11 ** Breaking changes
22 ** Changes since v2.90.0
3
4 - The "Version" column in ~magit-submodule-list-mode~ and
5 ~magit-repolist-mode~ buffers now shows when a repository is dirty.
6
37 ** Fixes since v2.90.0
48
59 - Staging and unstaging submodules while ~diff.submodule~'s value is ~log~
178178
179179 (defun magit-repolist-column-version (_id)
180180 "Insert a description of the repository's `HEAD' revision."
181 (let ((v (or (magit-git-string "describe" "--tags")
181 (let ((v (or (magit-git-string "describe" "--tags" "--dirty")
182182 ;; If there are no tags, use the date in MELPA format.
183183 (magit-git-string "show" "--no-patch" "--format=%cd-g%h"
184184 "--date=format:%Y%m%d.%H%M"))))
185185 (save-match-data
186 (when (string-match "-dirty\\'" v)
187 (put-text-property (1+ (match-beginning 0)) (length v) 'face 'error v))
186188 (if (and v (string-match "\\`[0-9]" v))
187189 (concat " " v)
188190 v))))