From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: git and orgmode: teaching git a bit of orgmode syntax Date: Tue, 24 Jan 2017 10:34:09 -0500 Message-ID: <87mveg79qm.fsf@gmail.com> References: <2017-01-24T16-07-08@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cW37X-0004Pw-8u for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 10:34:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cW37T-0004ey-9m for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 10:34:55 -0500 Received: from [195.159.176.226] (port=36704 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cW37T-0004eq-3Q for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 10:34:51 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cW36x-0000LH-1C for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 16:34:19 +0100 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 Karl Voit writes: > Hi! > > I am using gitwatch[1] to auto-commit any changes to my org-mode > files in a git repository. > > Unfortunately, git does not handle diffs in a meaningful way. For > example, when there are sub-hierarchies added or removed, it ends up > with many diff-lines like the following: > > -***** NEXT test with DAVdroid > +* Lesestoff [1/26] :2read: > :PROPERTIES: > -:CREATED: [2016-05-08 Sun 12:51] > +:CREATED: [2012-04-17 Tue 10:39] > +:ARCHIVE: %s_archive::* Lesestoff > +:CATEGORY: reading > :END: > > The two headings being compared by git are totally unrelated. Git > did find a match for the :PROPERTIES: and :END: lines and therefore > assumed that I modified the level five heading "NEXT test with > DAVdroid" into the first level heading "Lesestoff", not recognizing > that in fact, there were many org-mode lines moved to the archive > file, resulting in many deleted lines instead of modified ones. > > The underlying issue is, to my understanding, that git does not know > about Org-mode syntax elements. Git does not know that :PROPERTIES: > and :END: lines should not be used to match similar lines. It does > not know about headings, identifying CREATED time-stamps, and other > things. > > I am not familiar with git other than from an end user point of > view. But I do think that git can be taught here via some kind of > extension so that meaningful changes are recognized and displayed. > > Is there somebody with the same issue and/or somebody with a better > understanding how this issue can be addressed? > > Thanks! > > [1] https://github.com/nevik/gitwatch You can plug in a different diff tool into git. The next problem is to write/find/conjure a diff tool that *does* understand org syntax (at least to some extent). IIRC, there was a GSOC(?) project to do that some years ago, but I don't think it got finished (and maybe I'm misremembering in any case). If that really exists[fn:1], maybe it can form a starting point for another push. * Footnotes [fn:1] I'd search, but Gmane still seems non-compos-mentis and searching in the archives is just awful (or my fu is too weak). Anybody know what is happening with Gmane? How do you search the list nowadays? -- Nick