From: Phillip Wood Date: Wed, 15 Feb 2023 14:47:51 GMT Subject: Re: [PATCH 2/2] diff: teach diff to read gitattribute diff-algorithm Message-ID: <159f09b1-8a69-f662-637d-8e883c31d0ec@dunelm.org.uk> In-Reply-To: <230207.86sffh2xcu.gmgdl@evledraar.gmail.com> Hi Ævar On 07/02/2023 17:27, Ævar Arnfjörð Bjarmason wrote: > > On Tue, Feb 07 2023, Phillip Wood wrote: > >> This is slightly off topic but one thing I'd really like is a way to >> tell diff use automatically use --diff-words on some files >> (e.g. Documentation/*) > > Unlike changing the algorithm, -U options, diff.orderFile etc. doing > that would give you a diff that can't be applied with "git apply" or > other tools that expect a valid unified diff. That's a good point, we'd probably would want to guard it by checking if the output is going to a tty. > So I can imagine that it would be neat in some contexts, but such a > change would have much wider implications than options that tweak how a > valid unified diff looks, or is generated. > > We'd need some way to mark a diff as "for ad-hoc viewing only". > > But as it sounds like you want this for git.git the > Documentation/doc-diff script is much better than anything word-diff > could spew out, as it diffs the resulting generated docs. It's true that I should look at the doc-diff script for git, but it is a wider wish for text files in other projects as well. Best Wishes Phillip > I wonder (but haven't tried) whether you can't "diff" that using the > same method that can be used to diff binary files using a custom driver. > > Hrm, except that in that case (with includes etc) there isn't really a > 1=1 mapping between files within Documentation/ and generated docs (due > to includes etc.). But I suppose it could be used only for those files > that 1=1 correspond to the generated manpages.