From: Jeff King Date: Tue, 14 Feb 2012 20:38:01 GMT Subject: Re: [PATCH 6/8] gitweb: Highlight interesting parts of diff Message-ID: <20120214203801.GB23291@sigill.intra.peff.net> In-Reply-To: <20120214210453.16c6bd2e@gmail.com> On Tue, Feb 14, 2012 at 09:04:53PM +0100, MichaƂ Kiedrowicz wrote: > Sure, now it's a simple algorithm, but if we add more code, we will > have problems with making it consistent in both gitweb and > diff-highlight (which is nice-to-have IMO). True. I was thinking they would stay simple enough that porting features wouldn't be too painful. But that might be overly optimistic. > Note that my patches to gitweb already support combined diffs (in > obvious cases) while diff-highlight will fail on them badly (see for > example 09bb4eb4f14c). I haven't done it in diff-highlight because I > noticed that problem while working on patches for gitweb. Hmm. 09bb4eb4f14c looks fine to me, because all of the combined lines are from the left-hand side. A better example is 4802997, where the first hunk properly highlights, but the second does not (because we interpret the lines as context lines). Even worse is "git show 5de89d3 -- notes-cache.c", where we match a "- " line with a "++" line, and erroneously think the changes begin in the second character (even though it is simply a combined-diff marker). These are reasonably rare, so I don't consider them critical bugs, but yeah, it would be nice to fix. -Peff