Re: Use a *real* built-in diff generator
- From
Junio C Hamano <junkio@cox.net>
- Date
- Mar 25, 2006, 06:54 UTC
- Message-ID
- <7vk6ajxbe5.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0603241938510.15714@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> This uses a simplified libxdiff setup to generate unified diffs _without_ > doing fork/execve of GNU "diff".
Good stuff.
Show 8 quoted lines
> 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.