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 458372 - explicit message if files/directories are the same
explicit message if files/directories are the same
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: general
1.1.x
Other All
: Normal enhancement
: ---
Assigned To: Vincent Legoll
Stephen Kennedy
Depends on:
Blocks:
 
 
Reported: 2007-07-19 18:28 UTC by Marius Scurtescu
Modified: 2010-02-15 22:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add indicator dialog when files are identical (for 1.2.1) (656 bytes, patch)
2009-04-19 03:27 UTC, Jeff Oliver
none Details | Review
pass meldapp to melddocs (3.76 KB, patch)
2009-04-19 20:54 UTC, Vincent Legoll
none Details | Review
allow app actions sensitivity to be modified (567 bytes, patch)
2009-04-19 20:54 UTC, Vincent Legoll
none Details | Review
update up/down buttons sensitivity (1.84 KB, patch)
2009-04-19 20:55 UTC, Vincent Legoll
none Details | Review
add missing vcview constructor call (4.08 KB, patch)
2009-04-20 17:22 UTC, Vincent Legoll
none Details | Review
diff status bar (for 1.3.0) (6.09 KB, patch)
2009-05-01 05:42 UTC, Jeff Oliver
none Details | Review
Warp text cursor within jumped-to chunk (1.10 KB, patch)
2009-05-02 10:45 UTC, Vincent Legoll
committed Details | Review
Add diff info to doc status bar (7.22 KB, patch)
2009-05-03 04:54 UTC, Jeff Oliver
none Details | Review
Diff info in status bar. (7.61 KB, patch)
2009-05-22 04:02 UTC, Jeff Oliver
none Details | Review
Patch using a message area to notify user about identical files (18.80 KB, patch)
2009-06-29 08:21 UTC, Kai Willadsen
none Details | Review

Description Marius Scurtescu 2007-07-19 18:28:43 UTC
When comparing two identical files or directories there is no clear indication that they are the same.

You need to scan the color bar to see if there are any differences.

Either a popup message box or some other visual clue would help.
Comment 1 Jeff Oliver 2009-04-19 03:27:13 UTC
Created attachment 132889 [details] [review]
Add indicator dialog when files are identical (for 1.2.1)

Simple patch to throw up a dialog when the files diffed are identical.  My patch seems to be a little too much like a hack, anyone know of a better way to do this?
Comment 2 Vincent Legoll 2009-04-19 20:53:30 UTC
I've just posted a patch series on the ML which updates the up/down buttons sensitivity according to actual presence of diffs.

I prefer that to another new evil dialog.

I'm not against it, but that should have an option that default to "no dialog"
Comment 3 Vincent Legoll 2009-04-19 20:54:10 UTC
Created attachment 132920 [details] [review]
pass meldapp to melddocs
Comment 4 Vincent Legoll 2009-04-19 20:54:53 UTC
Created attachment 132921 [details] [review]
allow app actions sensitivity to be modified
Comment 5 Vincent Legoll 2009-04-19 20:55:23 UTC
Created attachment 132922 [details] [review]
update up/down buttons sensitivity
Comment 6 Jeff Oliver 2009-04-20 03:10:19 UTC
I guess I'm used to the "Files are Identical" dialog, since thats the behavior of the diff tool I am attempting to wean myself from ;).  In fact, the behavior of this other tool is to throw a dialog that says that they're identical then ask whether or not you still want to view the file.  This tool, however, is not a tabbed interface like Meld is, so that step may not be necessary for Meld.

Comment 7 Vincent Legoll 2009-04-20 17:22:27 UTC
Created attachment 132967 [details] [review]
add missing vcview constructor call
Comment 8 Vincent Legoll 2009-04-20 18:33:45 UTC
Would only greying the up & down buttons be sufficient for you or you really want a popup dialog ?

An optional dialog that asks if user want to skip the diff would be useful for big files for example, as an optimization...
Comment 9 Jeff Oliver 2009-04-20 20:54:05 UTC
I think its a matter of how one's eyes are trained.  I could retrain my eyes to look in certain places on the screen to tell whether or not something is a match or not.  Greying the buttons would work, however, if the idea is to grey the buttons if you're at the top/bottom of the diff list (or the file), you get a bit of a false positive if there is only 1 diff, or if the file is less than 1 screen long.  

A dialog box, although a bit rough, is definitely in your face, blatantly obvious that these files are the same, there is no thinking involved.

Perhaps some other indicator?  Like maybe the tab be a special color?
Comment 10 Vincent Legoll 2009-04-20 21:04:52 UTC
The patches I propose here grey the 2 button iff there's no diff at all, so that would be a good indicator.

But you're right that the other related bug:
http://bugzilla.gnome.org/show_bug.cgi?id=533752
asks for a greying at the top or bottom, which would cause the greying to not be a good indicator of no diff in file for a single difference.

But as meld goes automatically to the first diff, you'll have that diff displayed
right in the textviews, so this may still be sufficient...

I still thinks the dialog is another (sensible) way to tell there's no diff, and as it would allows to skip displaying (and highlighting) big files, that could be implemented too...
Comment 11 Jeff Oliver 2009-04-21 05:16:37 UTC
Another idea that just popped into my head is that we could use the status bar to convey this information....a section of the status bar could say something like "Diff X of Y", where I'd know immediately if it said "Diff 0 of 0" the files are the same.
Comment 12 Marius Scurtescu 2009-04-21 15:12:11 UTC
Yes, a status bar message should work.

When there are no diffs maybe the message can be made to stand out somehow, different color or bold?
Comment 13 Jeff Oliver 2009-05-01 05:42:16 UTC
Created attachment 133719 [details] [review]
diff status bar (for 1.3.0)

Quick diff status bar addition.  Shows Diff: X of Y in the status bar.  Unfortunately, it seems colors are difficult due to how things are drawn, but its a interesting concept.

I'm not that well versed in the internals of the diffing process and how the sequences work, so my calculations are probably pretty kludgy...any suggestions for cleaning that up would be appreciated.
Comment 14 Stephen Kennedy 2009-05-01 18:59:04 UTC
I had to modify the patch somewhat to make it work, but nice idea.

How about reusing the existing status bar? i.e. concatenating with 
the cursor position info. I'd find it easier to locate the message
if it was near the corner.

Also what should happen when the user scrolls the cursor? Should the 
"diff X of Y" only be displayed when the cursor is inside a diff chunk?
This would mean warping the cursor when pressing Ctrl+d & ctrl+e
which is probably what the user wants anyway.
Comment 15 Jeff Oliver 2009-05-01 21:38:29 UTC
(In reply to comment #14)
> I had to modify the patch somewhat to make it work, but nice idea.

Can you post the changes, or send them to me?  Was it the code or the patch file itself?

> 
> How about reusing the existing status bar? i.e. concatenating with 
> the cursor position info. I'd find it easier to locate the message
> if it was near the corner.

Yeah, concatenating with the cursor location status bar section is possible of course.  I can just modify the signals a bit.  There was mention of coloring things, but from the looks of it, you cannot color status bars.  It seems to want to draw its own coloring, probably thanks to GTK's theming stuff...so for now we'll do without.

> 
> Also what should happen when the user scrolls the cursor? Should the 
> "diff X of Y" only be displayed when the cursor is inside a diff chunk?
> This would mean warping the cursor when pressing Ctrl+d & ctrl+e
> which is probably what the user wants anyway.
> 
I was just throwing out a POC idea, I was only changing the information when the buttons are being pressed, but to round out the solution, all of the bases should be covered.  What if you press the hot keys?  What if you scroll manually up and down in a file?  Should you be directly on top of a diff for it to trigger the change, or simply within the vicinity?  What if there are multiple diff's viewable on the screen, should there be some indication of such thing?

Also, there is a minor side effect of this code...as you merge changes and things become more similar, the "of Y" part changes, obviously.  Personally I think that should be OK...

And again, I'm not sure the work I did to collect this information is all that great.  After thinking about it, I think there should probably be more methods added to the diffing classes to help determine how many diffs there are, and for a given line number(?) which diff we're sitting on...I'm just not that comfortable with my calculations.
Comment 16 Vincent Legoll 2009-05-02 10:45:03 UTC
Created attachment 133797 [details] [review]
Warp text cursor within jumped-to chunk

Is that one OK to commit ?

BTW I'm still working on the Up/Down button sensitivity thing,
but there are a lot of cases to cover.
Comment 17 Stephen Kennedy 2009-05-02 11:39:28 UTC
Yes, the cursor warp looks good - it's the first part of keyboard merging too, along with highlighting the current diff chunk.
Comment 18 Jeff Oliver 2009-05-03 04:54:25 UTC
Created attachment 133839 [details] [review]
Add diff info to doc status bar

Another stab at the diff status bar change.

This time the diff information is part of the existing doc status bar, I just increased the size of the bar a bit.

I added a couple of functions to the status bar class to aid in showing the tooltip information.  I was seeing a problem where using a button to move to the next diff was popping back to the wrong status information.

This patch is on top of the recently merged "cursor warping" patch, so I used the fact that the cursor is moving to determine where in the document we're at and which diff chunk we're sitting in.  So now, when you move the cursor by hand or using the next/prev hotkeys it works.  

There is only 1 bug with it...when warping to a deleted section, the cursor doesn't quite go to the location where the deletion occurred.  Because of that, the diff location does not update unless you move down a couple of lines to where the lines were actually deleted.
Comment 19 Vincent Legoll 2009-05-03 09:22:08 UTC
Yes I'm contemplating that bug and scratch my head to find a fix...

The bug is a little bit more than just for deleted sections, it
is wrong in the first pane (and probably in the third if there's
one)

I'll scratch a bit more before a reverting, but if I cannot find
it...
Comment 20 Jeff Oliver 2009-05-09 05:36:07 UTC
Well, looking at the next diff code, for "delete" and "replace" chunks, l0 would be the right place to put the cursor, but for "insert" chunks, l0 refers to the opposite pane.  On the pane the cursor is moving within l0 goes to the wrong line.

I changed:
buf.place_cursor(buf.get_iter_at_line(l0))
To:
buf.place_cursor(buf.get_iter_at_line(c[1]))

And my problem is resolved.  I don't know how this affects the issues you mention.
Comment 21 Jeff Oliver 2009-05-09 06:16:09 UTC
Actually, playing with it more, neither of the lines work right.  If you're cursor is in pane 1, you want to use pane 1's line information c[3] & c[4].  If your cursor is in pane 2, you want to use pane 2's line information c[1] & c[2].  My code that figures out the diff chunk the cursor is within isn't quite right either, since its not taking into account which pane the cursor was moved within.

Comment 22 Jeff Oliver 2009-05-22 04:02:56 UTC
Created attachment 135153 [details] [review]
Diff info in status bar.

Another shot at this one.

A couple of tweaks from the last patch.  The call to locate_chunk seemed to be returning the wrong chunk given the line.  Also, it seems that the place cursor call was placing the cursor 1 line past where it ought to.  Having said that, according to the chunk information, the cursor is in the right place, but due to the fact that the lines drawn and the coloring starts from the "bottom edge" of the given line, the cursor sits above the colored section upon warping.

So it ends up looking funny for inserted sections and replacement sections, but looks ok for deleted sections.

Also, this patch says "Diff: 1 of 4" if you're anywhere above the first diff.  Conversely, it says "Diff: 5 of 4" if you're below the last diff.  Which obviously looks funny.  How should it look?  Should we only show the diff info if your strictly within the bounds of a chunk? and leave it blank if the cursor is not?
Comment 23 Kai Willadsen 2009-06-29 08:19:37 UTC
I think that both of the ideas here -- sensitivity setting on up/down arrows, and chunk numbers in status bar -- are awesome and should happen, but I'd like to see something more obvious to address the original request. Two files being identical really is a big-flashing-notice kind of situation. I agree that pop-up dialogs are a no-no, but I think that a message area (ala gedit, or hotssh for the python version) is a good choice for this kind of display.

I'm attaching a patch that adds a copy of hotssh's msgarea.py to our tree, incorporates the message area into the glade files, and uses the message area to show a dismissible message when files are identical.

In the future (pending the app-centric gtk.Action issues that Vincent has already run into) we could add several enhancements to this. Obvious choices include a reload button, and a different message if the files are only the same *after* filtering, with a "Re-diff without filters" button. The message area could also be used for things such as file-change notification, and probably other stuff that I haven't thought of yet.
Comment 24 Kai Willadsen 2009-06-29 08:21:28 UTC
Created attachment 137541 [details] [review]
Patch using a message area to notify user about identical files
Comment 25 Stephen Kennedy 2009-07-01 22:39:45 UTC
The msgarea patch looks great. How about an accelerator to close the area?

This reminds me a little of the file/folder entry activation behavior conundrum. If the browse... button popped down a FileChooserWidget for every pane, all panes could reload when the popdown was closed.

Comment 26 Kai Willadsen 2009-07-02 01:13:13 UTC
> The msgarea patch looks great. How about an accelerator to close the area?

Added and committed. The appearance is a little odd - it's only on the first
area's button to avoid conflicting mnemonics. This looks slightly strange, but
works correctly.

> This reminds me a little of the file/folder entry activation behavior
> conundrum. If the browse... button popped down a FileChooserWidget for every
> pane, all panes could reload when the popdown was closed.

That's a really interesting idea. It sounds like the interaction should work
well and be more obvious than the current situation. FileChooserWidgets are
quite big, however, so having three (or even two) side-by-side would probably
have implications for Meld's required minimum window size.
Comment 27 Stephen Kennedy 2009-07-11 13:09:14 UTC
> That's a really interesting idea. It sounds like the interaction should work
> well and be more obvious than the current situation. FileChooserWidgets are
> quite big, however, so having three (or even two) side-by-side would probably
> have implications for Meld's required minimum window size.

I'd hate to impose a (large) window minimum size. We may need a custom container widget which could morph between a hbox and a notebook as the window size changed. Bonus if it can morph without abruptly popping.
Comment 28 Vincent Legoll 2009-07-15 22:32:46 UTC
I've created a new bug to track cursor and scrolledwindow warping bug / enhancement:

http://bugzilla.gnome.org/show_bug.cgi?id=588720
Comment 29 Vincent Legoll 2009-07-17 16:00:20 UTC
obsoleted the patches in this bug since the new ones in 
http://bugzilla.gnome.org/show_bug.cgi?id=588720
are the latest versions
Comment 30 Jeff Oliver 2010-01-25 01:03:08 UTC
I obsoleted my patches, since they're pretty old and I like the new message area notification.
Comment 31 Stephen Kennedy 2010-02-15 22:47:48 UTC
Great, then I think we're done here.