mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-13 22:10:18 +00:00
Add .dirty to git org-version info if files are modified
Shows files as modified by appending .dirty to indicate that you are running org-mode from a dirty working tree (some tracked files are modified)
This commit is contained in:
parent
a5e87a4723
commit
a32e8e8fec
|
@ -103,6 +103,7 @@
|
||||||
With prefix arg HERE, insert it at point."
|
With prefix arg HERE, insert it at point."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let* ((org-version org-version)
|
(let* ((org-version org-version)
|
||||||
|
(git-version)
|
||||||
(dir (concat (file-name-directory (locate-library "org")) "../" )))
|
(dir (concat (file-name-directory (locate-library "org")) "../" )))
|
||||||
(if (file-exists-p (expand-file-name ".git" dir))
|
(if (file-exists-p (expand-file-name ".git" dir))
|
||||||
(progn
|
(progn
|
||||||
|
@ -113,7 +114,11 @@ With prefix arg HERE, insert it at point."
|
||||||
(replace-regexp "-" ".")
|
(replace-regexp "-" ".")
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(re-search-forward "[^\n]+")
|
(re-search-forward "[^\n]+")
|
||||||
(setq org-version (concat org-version " (" (match-string 0) ")")))))
|
(setq git-version (match-string 0))
|
||||||
|
(shell-command (concat "cd " dir " && git diff-index --name-only HEAD --"))
|
||||||
|
(unless (eql 1 (point-max))
|
||||||
|
(setq git-version (concat git-version ".dirty")))
|
||||||
|
(setq org-version (concat org-version " (" git-version ")")))))
|
||||||
(let ((version (format "Org-mode version %s" org-version)))
|
(let ((version (format "Org-mode version %s" org-version)))
|
||||||
(message version)
|
(message version)
|
||||||
(if here
|
(if here
|
||||||
|
|
Loading…
Reference in a new issue