emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version infor


From: Bernt Hansen
Subject: Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Date: Wed, 19 Aug 2009 09:32:17 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Manish <address@hidden> writes:

> On Wed, Aug 19, 2009 at 6:00 PM, Bernt Hansen<address@hidden> wrote:
>> Manish,
>>
>> Could you try this patch - does it work?
>
> Patch application fails.  I tried with patch -p1 as well.
>
> ,----
> | [Wed 19 18:47] (2118) ~/elisp/org-mode.git $ git apply
> org-version-patch-by-bernt.patch
> | error: patch failed: lisp/org.el:104
> | error: lisp/org.el: patch does not apply
> `----
>
> -- 
> Manish

Can you try evaluating this? and then M-x org-version and report the
results?

(defun org-version (&optional here)
  "Show the org-mode version in the echo area.
With prefix arg HERE, insert it at point."
  (interactive "P")
  (let* ((org-version org-version)
         (git-version)
         (dir (file-truename (concat (file-name-directory (locate-library 
"org")) "../" ))))
    (if (file-exists-p (expand-file-name ".git" dir))
        (progn
         (shell-command (concat "GITDIR=" dir " && git describe --abbrev=4 
HEAD"))
         (save-excursion
           (set-buffer "*Shell Command Output*")
           (goto-char (point-min))
           (replace-regexp "-" ".")
           (goto-char (point-min))
           (re-search-forward "[^\n]+")
           (setq git-version (match-string 0))
           (shell-command (concat "GITDIR=" 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)))
      (if here (insert version))
      (message version)
      version)))

-Bernt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]