From: Junio C Hamano Date: Sat, 25 Mar 2006 06:54:10 GMT Subject: Re: Use a *real* built-in diff generator Message-ID: <7vk6ajxbe5.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Linus Torvalds writes: > This uses a simplified libxdiff setup to generate unified diffs _without_ > doing fork/execve of GNU "diff". Good stuff. > Now, in the interest of full disclosure, I should also point out a few > downsides: > > - the libxdiff algorithm is different,... > > - GNU diff does some nice eye-candy, like trying to figure out what the > last function was, and adding that information to the "@@ .." line. > libxdiff doesn't do that. That's kind of sad --- Documentation/SubmittingPatches request people to say "diff -u -p". > - The libxdiff thing has some known deficiencies. In particular, it gets > the "\No newline at end of file" case wrong. So this is currently for > the experimental branch only. I hope Davide will help fix it. Another thing I noticed is that while libxdiff always shows full line counts "-n,m +l,k" GNU seems to omit them when it can (m,k <=1). I am not sure if apply.c is set up to grok what libxdiff emits correctly. Running t/t1200 shows some obvious examples.