magit-repo-list-column-version: Show when repo is dirty
Jonas Bernoulli
5 years ago
0 | 0 |
* Magit v2.91.0 Release Notes (unreleased)
|
1 | 1 |
** Breaking changes
|
2 | 2 |
** 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 |
|
3 | 7 |
** Fixes since v2.90.0
|
4 | 8 |
|
5 | 9 |
- Staging and unstaging submodules while ~diff.submodule~'s value is ~log~
|
178 | 178 |
|
179 | 179 |
(defun magit-repolist-column-version (_id)
|
180 | 180 |
"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")
|
182 | 182 |
;; If there are no tags, use the date in MELPA format.
|
183 | 183 |
(magit-git-string "show" "--no-patch" "--format=%cd-g%h"
|
184 | 184 |
"--date=format:%Y%m%d.%H%M"))))
|
185 | 185 |
(save-match-data
|
|
186 |
(when (string-match "-dirty\\'" v)
|
|
187 |
(put-text-property (1+ (match-beginning 0)) (length v) 'face 'error v))
|
186 | 188 |
(if (and v (string-match "\\`[0-9]" v))
|
187 | 189 |
(concat " " v)
|
188 | 190 |
v))))
|