From: Junio C Hamano Date: Fri, 16 Oct 2009 20:05:11 GMT Subject: Re: Introduction and Wikipedia and Git Blame Message-ID: <7vpr8nt894.fsf@alter.siamese.dyndns.org> In-Reply-To: <7v7huvuptn.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > "jamesmikedupont@googlemail.com" writes: > >>> You would need to postprocess the computed result (either by diff or >>> blame) to lay out the final text output in either case anyway, and making >>> the existing blame engine do the work for you would be a better approach, >>> I think. >> >> Please can you tell me what is the basic algorithm of the blame engine? > > I think this is one of the most conprehensive write-up on the algorithm: > > http://thread.gmane.org/gmane.comp.version-control.git/28826/focus=28895 > > The whole thread (at least what I wrote in it) is worth reading if you > want to understand what the current code does. The first message in the > thread talks about "NEEDSWORK" label on an unimplemented part of the code, > and says "we could", but these gaps were since filled. Ah, nevermind. The thread is the definitive description of the blame algorithm, but I agree with Dscho that in this case, you either have to change blame itself to do this "byte-wise" comparison internally between versions, or re-do the blame logic yourself like Dscho suggests. Dscho is right in this case; an unmodifled blame engine, unless you feed a history that is converted to use the byte-per-line format, won't help you at all. So it would be either between rolling a custom byte-wise blame algorithm yourself and teaching a new byte-wise mode to existing blame engine. Sorry for making the task sound much easier than it would be.