|
From: | David Talmage |
Subject: | Re: [O] Insert git hash into exported document |
Date: | Wed, 28 Dec 2016 14:12:57 -0500 |
David Talmage writes:
> I'd like to insert the git hash of HEAD in the org-mode documents that I
> export. Is there an easy way? I'm exporting to LaTeX.
...
#+NAME: hash-from-lisp
#+BEGIN_SRC emacs-lisp
(shell-command-to-string "git rev-parse HEAD" )
#+END_SRC
#+RESULTS: hash-from-lisp
: 099b6ceee7264832b8e13f1156974b8017e6e4bb
You can hide the result using proper headers or the noexport tag and
then print the result in a verbose way:
The latest commit hash is src_emacs-lisp[:var i=hash-from-lisp]{(format "%s" i)}
[Prev in Thread] | Current Thread | [Next in Thread] |