After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 505087 - Differences and UP and DOWN buttons
Differences and UP and DOWN buttons
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: filediff
1.1.x
Other All
: Normal normal
: ---
Assigned To: Stephen Kennedy
Stephen Kennedy
: 538736 578119 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-12-22 18:57 UTC by Adriano
Modified: 2009-06-27 08:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
quick bugfix (1.58 KB, patch)
2008-08-02 16:06 UTC, Martin Renold
none Details | Review
regression test (left file) (33.21 KB, text/plain)
2009-04-10 20:18 UTC, Martin Renold
  Details
regression test (right file) (33.18 KB, text/plain)
2009-04-10 20:20 UTC, Martin Renold
  Details

Description Adriano 2007-12-22 18:57:44 UTC
Please describe the problem:
When I compare the two files below (and many others), meld up and down buttons doesn't go to all differences.

http://firebird.cvs.sourceforge.net/firebird/firebird2/builds/win32/msvc8/engine_embed.vcproj?revision=1.10.2.3&view=markup&pathrev=B3_0_Transition
http://firebird.cvs.sourceforge.net/firebird/firebird2/builds/win32/msvc8/engine_embed.vcproj?revision=1.10.2.4&view=markup&pathrev=B3_0_Transition

And the diff:
http://firebird.cvs.sourceforge.net/firebird/firebird2/builds/win32/msvc8/engine_embed.vcproj?r1=1.10.2.3&r2=1.10.2.4&pathrev=B3_0_Transition

When I enter in the compare window, the first difference is showed, and it go to the last one when I press the down button.

I'm using V 1.1.5.1 in Ubuntu Gutsy.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 matthieu 2008-02-21 22:19:38 UTC
I experienced the same bug as reported by Adriano. If it helps, I can post you two files that will allow to reproduce the problem. My version of meld is 1.1.5 (shipped in fedora8)

Maybe of interest:

- the 'diff bar' on the side of the text window correctly highlight a diff, but pressing the Down button jumps to the second match.

- meld file1 file2 does not behave as meld file2 file1 (I only get the problem one way)

Can the priority/severity for this bug be escalated? I would dread missing some diff because of this 'navigation' issue

I hope that can be fixed, meld is an excellent tool and extremely usefull
Comment 2 matthieu 2008-02-26 20:59:34 UTC
The problem seems to be within these lines in meld/filediff.py:
HTH




##                if c[1]+c1 == c[2]-c2:
##                   continue
                if c[1] > curline + 1:
                    break
        else: #direction == gdk.SCROLL_UP
            for chunk in self.linediffer.single_changes(1, self._get_texts()):
                c1,c2 = self._consume_blank_lines( self._get_texts()[1][chunk[1]:chunk[2]] )
##                if chunk[1]+c1 == chunk[2]-c2:
##                   continue
                if chunk[2] < curline:
                    c = chunk
                elif c:
                    break
Comment 3 Ross Collins 2008-07-23 16:03:41 UTC
I believe this is the same problem as reported here:

http://bugzilla.gnome.org/show_bug.cgi?id=538736

It didn't exist in version 1.1.4, but I'm seeing it in version 1.1.5.1.

I rely extensively on Meld as my favourite difference viewer / manual merger, so I need to trust it to show me all of the differences when I scroll up and down via these arrows. This is a subtle bug that would trick me otherwise, so I've downgraded back to version 1.1.4 until it is fixed.
Comment 4 Martin Renold 2008-07-31 19:07:53 UTC
More precisely, line removals (lines that exist on the left side only) are not reachable with the up/down buttons except if it is the last change in the file.

I guess there is something fishy with how _consume_blank_lines() is used.
Comment 5 Martin Renold 2008-08-02 16:06:42 UTC
Created attachment 115738 [details] [review]
quick bugfix

Here is a bugfix. Tested with two- and three way diffs.

I have found related bugs on the way which I'd like to fix more intrusively. Perhaps by removing _consume_blank_lines. It would help if someone can tell me why blank lines within a single change are supposed to be consumed at all.
Comment 6 Martin Renold 2008-08-03 17:56:36 UTC
I have attached an better but more intrusive fix for the problem here to Bug #392640. My patch here is obsolete, unless you don't like the new one.
Comment 7 Sorin Anton 2008-09-24 11:59:18 UTC
I think the problem might be that UP and DOWN (go to prev/next difference) only goes where there are differences (blue background) and not isolated blocks (green background).

IMHO the jump (to next / prev difference) feature should jump to green zones too, because they are also very important in a comparison.
Comment 8 Kai Willadsen 2008-09-25 22:44:00 UTC
*** Bug 538736 has been marked as a duplicate of this bug. ***
Comment 9 matthieu 2009-02-26 22:07:13 UTC
A friend using Ubuntu Jaunty told that had been patched, at least he did not get the problem with two files that were causing the pb on my side. I look it up on the web and applied that patch.
Comment 10 Alexey Rusakov 2009-02-26 22:35:57 UTC
Could you please attach the patch here? Or at least post the link to it...
Comment 11 matthieu 2009-02-26 23:07:52 UTC
I think I started from this link. Reading it all more carefully, I see `Patch by Martin Renold`, who posted on this thread earlier. What'd be great is one unified meld because when I pulled it from svn trunk last week, it was not obvious it was included. I really mean to say this constructively: meld is top-notch great.

https://launchpad.net/ubuntu/jaunty/+source/meld/1.2-0ubuntu1

Comment 12 Martin Renold 2009-02-28 08:17:20 UTC
Just a reminder that I have updated my two-bugfixes-in-one patch at Bug #392640 to current svn again.
Comment 13 Kai Willadsen 2009-03-28 07:22:53 UTC
In current SVN, this bug should be fixed when the "Ignore blank lines" preference is turned off. When that preference is turned on, there are some remaining problems, so I'm leaving this open for now.

Please test SVN and report any problems you experience with the blank lines preference turned off.
Comment 14 Vincent Legoll 2009-04-07 07:48:08 UTC
*** Bug 578119 has been marked as a duplicate of this bug. ***
Comment 15 Martin Renold 2009-04-10 20:16:13 UTC
I can confirm that this bug is fixed. With "Ignore blank lines" I found no remaining problems.

With "ignore blank lines" enabled I found two issues left. One is Bug #392640. The other is that Meld skips blank lines with Ctrl-D/Ctrl-E if they appear in the right file, but stops at the change if they are in the left file.

Both issues are really minor to me compared to the original bug.
Comment 16 Martin Renold 2009-04-10 20:18:49 UTC
Created attachment 132493 [details]
regression test (left file)
Comment 17 Martin Renold 2009-04-10 20:20:23 UTC
Created attachment 132494 [details]
regression test (right file)
Comment 18 Martin Renold 2009-04-10 20:25:24 UTC
The attached files are crafted to test all the different cases that used to be problematic.
Comment 19 Kai Willadsen 2009-06-27 08:08:01 UTC
Those test cases are great, thanks. I've just committed a fix to git head that, according to my testing and to the test cases, addresses all of the issues identified when "Ignore blank lines" is enabled.

I'm closing this bug, but further testing is very welcome. Please file new bugs for any problems encountered. Thanks for the bug report.