Browse Source

Remove "release_" prefix from org-version when org-fixup is run

* UTILITIES/org-fixup.el: Remove "release_" prefix from org-version
  when it is established from git.
Achim Gratz 9 years ago
parent
commit
4ea1573b9d
1 changed files with 8 additions and 13 deletions
  1. 8 13
      UTILITIES/org-fixup.el

+ 8 - 13
UTILITIES/org-fixup.el

@@ -81,19 +81,14 @@
 	(unwind-protect
 	    (progn
 	      (cd dirorg)
-	      (setq org-git-version
-		    (concat (substring
-			     (shell-command-to-string "git describe --abbrev=6 HEAD")
-			     0 -1)
-			    (when (string-match "\\S-"
-						(shell-command-to-string
-						 "git status -uno --porcelain"))
-			      ".dirty")))
-	      (setq org-version
-		    (substring
-		     (shell-command-to-string "git describe --abbrev=0 HEAD")
-		     0 -1))))
-	(cd origin)))
+	      (let (( git6 (substring (shell-command-to-string "git describe --abbrev=6 HEAD") 0 -1))
+		    ( git0 (substring (shell-command-to-string "git describe --abbrev=0 HEAD") 0 -1))
+		    ( gitd (string-match "\\S-" (shell-command-to-string "git status -uno --porcelain"))))
+		(setq org-git-version (concat git6 (when gitd ".dirty")))
+		(if (string-match "^release_" git0)
+		    (setq org-version (substring git0 8))
+		  (setq org-version git0)))
+	      (cd origin)))))
     `(progn
        (defun org-release () ,org-version)
        (defun org-git-version () ,org-git-version)