From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Welle Subject: Re: Insert git hash into exported document Date: Sat, 24 Dec 2016 10:07:11 +0100 Message-ID: <87a8blofuo.fsf@luisa.c0t0d0s0.de> References: <16430f8b1ffe49dc987db8e599900630@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <878tr6whpd.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKiIV-0005hn-OA for emacs-orgmode@gnu.org; Sat, 24 Dec 2016 04:07:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKiIS-0000CL-In for emacs-orgmode@gnu.org; Sat, 24 Dec 2016 04:07:23 -0500 Received: from mout.gmx.net ([212.227.15.19]:60594) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cKiIS-0000B4-83 for emacs-orgmode@gnu.org; Sat, 24 Dec 2016 04:07:20 -0500 Received: from stella.c0t0d0s0.de ([82.113.121.113]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M0y47-1cYwCA0nCZ-00v9jT for ; Sat, 24 Dec 2016 10:07:17 +0100 Received: from Stella (stella.c0t0d0s0.de [192.168.42.1]) by stella.c0t0d0s0.de (Postfix) with ESMTP id 9F705C45D1 for ; Sat, 24 Dec 2016 10:07:11 +0100 (CET) In-Reply-To: <878tr6whpd.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Fri, 23 Dec 2016 19:47:42 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hello, Eric S Fraga writes: > On Friday, 23 Dec 2016 at 17:34, David Talmage wrote: >> 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. > > Anything you can do in a shell could be exported to LaTeX. E.g. I do > the following with mercurial in one of my documents: > > #+begin_src org > ,* Recent change history > ,#+name: changehistoryshellblock > ,#+begin_src shell :exports results :results output > hg log --template "{date|shortdate} {desc|firstline}\n" --limit 10 fresa.org > ,#+end_src > #+end_src do you have some mechanism that warns you if you try to export uncommitted changes? I'm not sure how such a process should be designed. I think most of the time you publish preliminary revisions and then you will hate such a warning. On the other hand, I often do work twice when publishing the final revision, because I forget to checkin and then the history in the export is wrong. Regards hmw