[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] [PATCH 2/2] Add .dirty to git org-version info if files are mo
From: |
Bernt Hansen |
Subject: |
[Orgmode] [PATCH 2/2] Add .dirty to git org-version info if files are modified |
Date: |
Tue, 18 Aug 2009 13:22:43 -0400 |
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)
---
lisp/org.el | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 3560a50..26b2808 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -103,6 +103,7 @@
With prefix arg HERE, insert it at point."
(interactive "P")
(let* ((org-version org-version)
+ (git-version)
(dir (concat (file-name-directory (locate-library "org")) "../" )))
(if (file-exists-p (expand-file-name ".git" dir))
(progn
@@ -113,7 +114,11 @@ With prefix arg HERE, insert it at point."
(replace-regexp "-" ".")
(goto-char (point-min))
(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)))
(message version)
(if here
--
1.6.4
- [Orgmode] [PATCH 0/2] Teach org-version to include git version information, Bernt Hansen, 2009/08/18
- [Orgmode] [PATCH 2/2] Add .dirty to git org-version info if files are modified,
Bernt Hansen <=
- [Orgmode] [PATCH 1/2] Add git version number to org-version information, Bernt Hansen, 2009/08/18
- Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information, Carsten Dominik, 2009/08/18
- Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information, Manish, 2009/08/19
- Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information, Bernt Hansen, 2009/08/19
- Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information, Manish, 2009/08/19