From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wL+QCGsknWNMMQEAbAwnHQ (envelope-from ) for ; Sat, 17 Dec 2022 03:07:39 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id aLCOCGsknWNLigAAauVa8A (envelope-from ) for ; Sat, 17 Dec 2022 03:07:39 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AB9AD3B007 for ; Sat, 17 Dec 2022 03:07:38 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6MbH-0002e2-3W; Fri, 16 Dec 2022 21:06:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6MbF-0002cA-Q2 for emacs-orgmode@gnu.org; Fri, 16 Dec 2022 21:06:53 -0500 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6MbD-0005VQ-NZ for emacs-orgmode@gnu.org; Fri, 16 Dec 2022 21:06:53 -0500 Received: by mail-lf1-x12d.google.com with SMTP id q6so6104831lfm.10 for ; Fri, 16 Dec 2022 18:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=Y6Heg4p9t0h68uci3RarIF5MByZNmnGvD7UBCCwaLys=; b=Kl6sRXs26gJWEMMvXwubbI5Cx6iY7c17+8dEu0GwOer4vsEyHS3NlTlgvJ94RGLX6v sNHlEjRR+PKPAMAy1LOWO+Bc/jhPeOiG5G5TPmUCyflQ2H6Qw/K2XP8jC91ZL+Wc/JU6 ddbo6pXpSxDnGbhwoSVRU+ZbECvIGAY/Jf0dULt8DdfFoydafMeg1Jzc2W2CJnYS9vI9 /mwG8G1eDjpsddOS+cTHOAsy/+1Rwcq1VMO1imz+FJYitLdxJGJ/wLctR4UYodc8tGz/ iWM7k71HcofFSiJ7D9lSoXdxfZQBIkeZyg0gTy0y6D05I9BJOgrPEmpGbj34UzQPYbuA 6Yfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y6Heg4p9t0h68uci3RarIF5MByZNmnGvD7UBCCwaLys=; b=30ARV7M5n14FaTuSKeBgoJcfPP3KezSUaoMLF2Im7PSbrOReBpgEXBIa3HYBB2rB3/ BZrFKFdexH2xNTJovwAlLPuAje6s3KBRDOo9VY4PfbGgxEYx5dNDWGzICEJf3WUGA0t2 Zf/+BFp0LLvLo6wuPj2viSaKVdZluwy543z/jtu7q7czrohL7xFga0x8MnhC9CU/RN36 kR/6z9TyJsAredrWaUf35ilA6mJs1CwvFAgaCK9COm5RVt7iYeX05XjHuwXvNVQFYgeT XpHm8zsNMTvmfFK91rpPYYNdJX2DRAWeaAUa6MfOK5cXXkbo3eY0hRnhP5U1uxks7s2C yfNQ== X-Gm-Message-State: ANoB5plkxSNXnpAMqFBQAvQu6+nl/A2qUCDnb4Xbzo5EtcN3ZjKLcmN4 VWu/KZmZoq7w1Pn0jjbNyb3Fe0+6zHuwqyqld7jeYlH0Incr5k8m X-Google-Smtp-Source: AA0mqf6tn58MrHb6qmhsgwj46dmbaVPMDK9dtB88Ue9YTEwfFX3CPSy4mbGP+1GlPkPK7IePiqPNb4z5eYetrByW8XY= X-Received: by 2002:a19:550a:0:b0:4b5:90be:af2d with SMTP id n10-20020a19550a000000b004b590beaf2dmr6295928lfe.597.1671242808345; Fri, 16 Dec 2022 18:06:48 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a9a:7145:0:b0:22e:c163:faca with HTTP; Fri, 16 Dec 2022 18:06:46 -0800 (PST) In-Reply-To: References: From: Samuel Wales Date: Fri, 16 Dec 2022 19:06:46 -0700 Message-ID: Subject: Re: [OT] org and diff To: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=samologist@gmail.com; helo=mail-lf1-x12d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671242858; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Y6Heg4p9t0h68uci3RarIF5MByZNmnGvD7UBCCwaLys=; b=Z8IgKnnAvntnin99wbDD3yTrBEZi6ybZAYSIawyRDSw9rnssKU5SFwz7r6aDRsgLglN1wm YkpcHqxGBGLYily8Z0cMuEPKJKwAK632RGnnGrau5CWg/XjhU6LpmPoEoN6lTY7KH1PDyz 2YyxaJSGUZyX75+aXiwK7gHJ2MH6sRYZqEJ9dk/yk0FLrflcuwircOWeeAeq7R2TcFTBwd j8EbCcB+lBQjnc87qsJP3RO1a8xvG/n0wfwczr+Xf6zQWStdOg8xRomqX8cMW68sOscjWY kEp0F7NQ7ZksghVLvozDfmLLLPKuKbGfXCSu3jKMxl8eiTNOoQ8vQAjuGFTcqA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Kl6sRXs2; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671242858; a=rsa-sha256; cv=none; b=Rbu8/L6nI/HE9Cn73mWJNZuqYSLTK6oQectuzhRcWUvLzIceqEpw/zXaCam40GxetPb1eS PQs/OrCJXUyrk5+1EkgDQU/uNmA3HKolmSf3CBT6FGo3jzhtGAU+ypjTFYjo5fQAkKNZbs i6dsJDm7HgeMXesGMH8zUT2upQLZTsW0OeXqzQeox923bGvAmPVwm58JB1g0d2woovUoEL WrZfYy7bnu6qPmgFaCrtEfUsDpO5R4Ony8+BNhZHIvju/x62YeKnAvqthcxlbqmYh7ApVN M5KK6OgbyPmr/kpaxn+L4h++ZW7l2e55sZdf/eggWsdJKpbHTB9d1tPP2bu2kg== X-Migadu-Spam-Score: -5.97 X-Spam-Score: -5.97 X-Migadu-Queue-Id: AB9AD3B007 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Kl6sRXs2; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com X-TUID: L5t0r8oi4k0A marcin> One question I'd ask is: how important a legible diff is to you? I keep my Org files in Git, too, but if /I/ know what was changed, I just don't care about diff going nuts and I treat it as (more or less) Git's internal implementation detail. for org, i mostly use git for reviewing changes. it is only one step more sophisticated than saving old and diffing. i have lots of tools for improving diff, but this intermingling problem is a showstopper in some cases, like right now where i have spent months trying to make sense of months of changes to org files that have not been entered into git. i.e. i did not enter every few days as normal. i find reviewing changes to be valuable. every once in a while i discover data corruption or something that i forgot etc. i wonder if diff, or difftastic, could be taught or postprocessed to do merely one thing: try to preserve stuff between "^\\*+ ". that is probably too optimistic, but imagine a --preserve-between option. On 11/21/22, Samuel Wales wrote: > incidentally, if you want empty hunk headers, you can do this at least > in my version of git: > > xfuncname = " " > > but idk why it works and i had had it commented out. > > > On 11/21/22, Samuel Wales wrote: >> p.s. hunk header munging does not unmingle [i.e. group changes by org >> header in magit status buffer diffs] :(. but it is true that what i >> want is some kind of preference given by magit to org entries as >> demarcated by org headings. >> >> idk if what i want is in principle possible or not in standard diff or >> git diff. that is, idk if they could be patched to accept an arg that >> would allow you to specify that org entries should be preserved if >> possible or something like that. >> >> great to know difftastic can in principle be coded to do what i want, >> however. so maybe soetime you could tell git to use. >> >> org hunk headers are rather nice looking. on the other hand, it gets >> the previous header, even if not the parent header. i think this is >> why i had the impression that git was in principle incapable of org >> hunk header text of the type i wanted. but hunk header text is not >> something i use a lot. it's rather nice looking, but in some cases i >> prefer empty hunk headers. >> >> On 11/12/22, Samuel Wales wrote: >>> i have a very old version of Magit, for reasons I won't get into. >>> Fancier diff settings might be differnet or not available. >>> >>> But something drives me crazy. Probably not too Org-related, but it >>> might be. I just want to know why, is all. >>> >>> I have a 24k line org file, and it's not that complex wrt levels. 2 >>> or 3 levels with odd stars only. various types of content. >>> >>> someplace in it, is an entry with a 234-item plain list. if i try to >>> move this entry, and make no other changes, diff goes insane. if i >>> try to refile this entry to a different org file, diff similarly goes >>> insane, with the - part. only that change. >>> >>> ok, what it does is, intersperse or mingle entries. so suppose i want >>> to stage this one tiny little change, namely moving one entry [the one >>> with the large plain list] to a different location in the same file. >>> even if i move it really distantly. >>> >>> i.e. i want to put the - and the + of the move to the staging area in >>> magit. unstaged changes should then not have this file in it at all >>> after the staging operations. >>> >>> then, basically, staged changes will have this move. >>> >>> as a user, i want diff to make this two hunks, a big - and a big +. >>> but diff mingles parts of another entry or entries with this list, so >>> that it is scattered all over the diff. to get the result i want >>> requires tons of intra-hunk stage operations. at best. >>> >>> so, what aspect of diff or org is triggering this kind of behavior? >>> what is it that diff needs to understand about org, or what minimality >>> etc. settings does it want to create a better diff? >>> >>> i know org has lots of similar lines [e.g. planning headers with >>> scheduled dates that are identical]. but still, this is a nontrivial >>> size org file, with no other changes that i made. diff's insanity >>> still occurs even if i move the entry distantly. >>> >>> i am of course aware of histogram, patience, etc. and that git diff >>> has a few experimental choices of options. also long ago i read diff >>> manual with its discussion of end of file beg of file and minimality >>> with --minimal and all that stuff. >>> >>> however, here, though, i am mostly interested in specifically what >>> diff's, or git diff's, or magit's, /deal/ is. in /this/ case. >>> >>> where does it get off doing that? everything else is the same, so why >>> is it keying on the wrong thing? >>> >>> does it think i made the changes as it presents them, or does it go >>> for some other goal like minimality or speed and not really care what >>> i did? is it because it e.g. ignores end or beg of file or so? or is >>> it getting confused by some line? >>> >>> i have of course heard of merge something or others. which presumably >>> tell diff about the structure of files or so. like, the fact that the >>> planning line always follows the header. or perhaps i am imagining >>> this kind of tool. >>> >>> now, whether i can mitigte it is interesting /after/ that. my >>> paleolithic magit version might not be capable, but still. >>> >>> -- >>> The Kafka Pandemic >>> >>> A blog about science, health, human rights, and misopathy: >>> https://thekafkapandemic.blogspot.com >>> >> >> >> -- >> The Kafka Pandemic >> >> A blog about science, health, human rights, and misopathy: >> https://thekafkapandemic.blogspot.com >> > > > -- > The Kafka Pandemic > > A blog about science, health, human rights, and misopathy: > https://thekafkapandemic.blogspot.com > -- The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com