From 4ea1573b9deedb4fa9fe4acaffbccc98a8b57964 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Thu, 17 May 2012 12:53:32 +0200 Subject: [PATCH] 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. --- UTILITIES/org-fixup.el | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/UTILITIES/org-fixup.el b/UTILITIES/org-fixup.el index a7e64b179..bf70a8049 100644 --- a/UTILITIES/org-fixup.el +++ b/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) -- 2.11.4.GIT