From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stig Brautaset Subject: Re: git and orgmode: teaching git a bit of orgmode syntax Date: Tue, 24 Jan 2017 23:16:03 +0100 Message-ID: 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]:37059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cW9O4-0002qC-JG for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 17:16:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cW9O1-0000A9-FK for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 17:16:24 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:41943) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cW9O1-00009h-8c for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 17:16:21 -0500 In-reply-to: <2017-01-24T16-07-08@devnull.Karl-Voit.at> 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: Karl Voit Cc: emacs-orgmode@gnu.org Karl Voit writes: > 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. You may want to try setting =diff.algorithm= (see =man git-config=) to either =patience= or its variant =histogram=. This Stack Overflow answer contains an example of how the effects of the diff created with the patience algorithm, and it looks similar to the case you're describing: http://stackoverflow.com/questions/4045017/what-is-git-diff-patience-for#4045087 You may also want to check out the option =diff.compactionHeuristic=, which is described thus: ,---- | Set this option to true to enable an experimental heuristic that | shifts the hunk boundary in an attempt to make the resulting patch | easier to read. `---- Stig