Re: Re* [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Jeff King
On Fri, Jun 10, 2016 at 11:13:10AM -0700, Junio C Hamano wrote: > Jacob Keller writes: > > > I think we could use the indentation trick and it might help in this > > case. I agree, let's disable this for this cycle and experiment in the > > next one. Good catch, Peff. > > > > As others have said

Re: Re* [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Stefan Beller
On Fri, Jun 10, 2016 at 11:13 AM, Junio C Hamano wrote: > Subject: [PATCH] diff: disable compaction heuristic for now > > http://lkml.kernel.org/g/20160610075043.ga13...@sigill.intra.peff.net > reports that a change to add a new "function" with common ending > with the existing one at the end of t

Re* [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Junio C Hamano
Jacob Keller writes: > I think we could use the indentation trick and it might help in this > case. I agree, let's disable this for this cycle and experiment in the > next one. Good catch, Peff. > > As others have said you will always be able to produce counter > examples, that's the nature of he

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Jacob Keller
On Fri, Jun 10, 2016 at 9:25 AM, Stefan Beller wrote: > On Fri, Jun 10, 2016 at 8:56 AM, Junio C Hamano wrote: >> Jeff King writes: >> >>> On Fri, Jun 10, 2016 at 03:50:43AM -0400, Jeff King wrote: >>> I found a false positive with the new compaction heuristic in v2.9: [...] >>> >>> An

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Stefan Beller
On Fri, Jun 10, 2016 at 8:56 AM, Junio C Hamano wrote: > Jeff King writes: > >> On Fri, Jun 10, 2016 at 03:50:43AM -0400, Jeff King wrote: >> >>> I found a false positive with the new compaction heuristic in v2.9: >>> [...] >> >> And by the way, this is less "hey neat, I found a case" and more "w

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Junio C Hamano
Jeff King writes: > On Fri, Jun 10, 2016 at 03:50:43AM -0400, Jeff King wrote: > >> I found a false positive with the new compaction heuristic in v2.9: >> [...] > > And by the way, this is less "hey neat, I found a case" and more "wow, > this is a lot worse than I thought". > > I diffed the old a

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Michael Haggerty
On 06/10/2016 10:41 AM, Jeff King wrote: > On Fri, Jun 10, 2016 at 10:31:13AM +0200, Michael Haggerty wrote: > >> I've often thought that indentation would be a good, fairly universal >> signal for diff to use when deciding how to slide hunks around. Most >> source code is indented in a way that s

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Jeff King
On Fri, Jun 10, 2016 at 10:31:13AM +0200, Michael Haggerty wrote: > I've often thought that indentation would be a good, fairly universal > signal for diff to use when deciding how to slide hunks around. Most > source code is indented in a way that shows its structure. > > I propose the following

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Michael Haggerty
On 06/10/2016 09:50 AM, Jeff King wrote: > I found a false positive with the new compaction heuristic in v2.9: > [...] > I get this rather unfortunate diff: > > $ git diff > diff --git a/file.rb b/file.rb > index bd9d1cb..67fbeba 100644 > --- a/file.rb > +++ b/file.rb > @@

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Jeff King
On Fri, Jun 10, 2016 at 03:50:43AM -0400, Jeff King wrote: > I found a false positive with the new compaction heuristic in v2.9: > [...] And by the way, this is less "hey neat, I found a case" and more "wow, this is a lot worse than I thought". I diffed the old and new output for the top 10,000

[BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Jeff King
I found a false positive with the new compaction heuristic in v2.9: -- >8 -- # start with a simple file cat >file.rb <<\EOF def foo do_foo_stuff() common_ending() end EOF git add file.rb git commit -m base # and then add another function with a similar ending cat >>file.rb <<\EOF def bar