Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Morten Welinder
>> Is there a reason why picking among the choices in a sliding window >> must be contents neutral? > > Sorry, you might be getting at something interesting but I do not > understand the question. I have no idea what you mean by "contents > neutral". I was merely asking if an algorithm to pick be

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Michael Haggerty
On 12/12/2012 10:53 PM, Junio C Hamano wrote: > Morten Welinder writes: > >> Is there a reason why picking among the choices in a sliding window >> must be contents neutral? > > Sorry, you might be getting at something interesting but I do not > understand the question. I have no idea what you

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Junio C Hamano
Javier Domingo writes: > I must say it is _quite_ helpfull having the diffs well done (natural > diffs as here named), just because when you want to review a patch on > the fly, this sort of things are annoying. I do not think anybody is arguing that it would not help the human users to shift th

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Javier Domingo
I must say it is _quite_ helpfull having the diffs well done (natural diffs as here named), just because when you want to review a patch on the fly, this sort of things are annoying. I just wanted to say my opinion. No idea on how to fix that, nor why does it happen. Javier Domingo 2012/12/12 A

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Junio C Hamano
Morten Welinder writes: > Is there a reason why picking among the choices in a sliding window > must be contents neutral? Sorry, you might be getting at something interesting but I do not understand the question. I have no idea what you mean by "contents neutral". Picking between these two cho

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Morten Welinder
> So I think with s/Regularly/About half the time/, your observation > above is correct. > > I think the reason you perceived this as "Regularly" is that you do > not notice nor appreciate it when things go right (half the time), > but you tend to notice and remember only when a wrong side happened

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Junio C Hamano
Junio C Hamano writes: > Kevin writes: > >> Regularly I notice that the diffs that are provided (through diff, or >> add -p) tend to disconnect changes that belong to each other and >> report lines being changed that are not changed. >> >> An example for this is: >> >> /** >> + * Defaul

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Kevin
Yeah, I didn't mention it, but I didn't think it was doing this wrong in a systematic way. I only wondered if there was some kind of heuristic that could improve the cases where it goes wrong, without affecting the cases where it would do it right. I know this is not an easy problem, lest it would

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Brian J. Murrell
On 12-12-12 01:29 PM, Junio C Hamano wrote: > > Here the end of the pre-context matches the end of the added lines, > but it will produce worse result if you blindly apply the "shift the > hunk up" trick: Yeah. I would not think a blind shift would be appropriate. But I wonder if diff can take

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Junio C Hamano
Kevin writes: > Regularly I notice that the diffs that are provided (through diff, or > add -p) tend to disconnect changes that belong to each other and > report lines being changed that are not changed. > > An example for this is: > > /** > + * Default parent > + * > + * @var in