Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335082 - Add rename detection to compare with...
Summary: Add rename detection to compare with...
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-22 05:03 EST by Robin Rosenberg CLA
Modified: 2013-05-24 18:04 EDT (History)
4 users (show)

See Also:


Attachments
alternative proposal for rename overlay icon (159 bytes, image/gif)
2013-05-20 19:21 EDT, Matthias Sohn CLA
no flags Details
tooltip for renamed files (5.84 KB, patch)
2013-05-21 08:13 EDT, Robin Stocker CLA
no flags Details | Diff
smaller version of JDT's correction_rename.gif (107 bytes, image/gif)
2013-05-21 09:12 EDT, Markus Keller CLA
no flags Details
staged_added_lighter.gif (852 bytes, image/gif)
2013-05-21 13:58 EDT, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Rosenberg CLA 2011-01-22 05:03:36 EST
The various places where we open a compare editor should be able to utilize rename detection.
Comment 1 Robin Rosenberg CLA 2013-05-14 15:51:31 EDT
Added to compare with ancestor in history: https://git.eclipse.org/r/12791
Comment 2 Robin Stocker CLA 2013-05-18 07:26:25 EDT
Nice! UI comments:

* The renamed file is shown in grey if the history was filtered (e.g. to the file or folder). That's caused by the DiffEntry being created by RenameDetector not having the marks. Could be fixed by using the marks from the dst in DiffEntry.pair.

* Where is the rename decoration icon from? I'm wondering if there is an existing icon in Eclipse somewhere with this meaning. Maybe something with an arrow?

* It would be nice if one could see the old name in the table. Maybe it could be added at the end, something like "foo.txt (renamed from bar.txt)"? Or as a tooltip?
Comment 3 Robin Stocker CLA 2013-05-19 09:29:01 EDT
(In reply to comment #2)
> * The renamed file is shown in grey if the history was filtered (e.g. to the
> file or folder). That's caused by the DiffEntry being created by
> RenameDetector not having the marks. Could be fixed by using the marks from
> the dst in DiffEntry.pair.

Pushed JGit change for this:

https://git.eclipse.org/r/12969
Comment 4 Robin Rosenberg CLA 2013-05-20 17:37:22 EDT
(In reply to comment #2)
> Nice! UI comments:
> 
> * The renamed file is shown in grey if the history was filtered (e.g. to the
> file or folder). That's caused by the DiffEntry being created by
> RenameDetector not having the marks. Could be fixed by using the marks from
> the dst in DiffEntry.pair.
> 
> * Where is the rename decoration icon from? I'm wondering if there is an
> existing icon in Eclipse somewhere with this meaning. Maybe something with
> an arrow?

I modified to something else, more like what you see when you do label editing.

> * It would be nice if one could see the old name in the table. Maybe it
> could be added at the end, something like "foo.txt (renamed from bar.txt)"?
> Or as a tooltip?

Tooltip or gittish style path/{added/}name. Doing this nicely, along with the names in the compare UI, requires a lot more code and some thinking. The patch I submitted is trivial in comparison. I suggest that is a future patch (possible 3.0, but not necessarily).
Comment 5 Matthias Sohn CLA 2013-05-20 19:21:41 EDT
Created attachment 231227 [details]
alternative proposal for rename overlay icon
Comment 6 Matthias Sohn CLA 2013-05-20 19:24:58 EDT
(In reply to comment #4)
> (In reply to comment #2)
> > Nice! UI comments:
> > 
> > * The renamed file is shown in grey if the history was filtered (e.g. to the
> > file or folder). That's caused by the DiffEntry being created by
> > RenameDetector not having the marks. Could be fixed by using the marks from
> > the dst in DiffEntry.pair.
> > 
> > * Where is the rename decoration icon from? I'm wondering if there is an
> > existing icon in Eclipse somewhere with this meaning. Maybe something with
> > an arrow?
> 
> I modified to something else, more like what you see when you do label
> editing.

Looks better but still hard to read e.g. when overlayed to the Java source file icon. I attached another proposal which I feel is a bit easier to read.

> > * It would be nice if one could see the old name in the table. Maybe it
> > could be added at the end, something like "foo.txt (renamed from bar.txt)"?
> > Or as a tooltip?
> 
> Tooltip or gittish style path/{added/}name. Doing this nicely, along with
> the names in the compare UI, requires a lot more code and some thinking. The
> patch I submitted is trivial in comparison. I suggest that is a future patch
> (possible 3.0, but not necessarily).

I agree
Comment 7 Robin Stocker CLA 2013-05-21 08:10:16 EDT
(In reply to comment #6)
> Looks better but still hard to read e.g. when overlayed to the Java source
> file icon. I attached another proposal which I feel is a bit easier to read.

Looks better. Is there a specific reason it shows an "e"? Maybe an "r" (for rename) would be better?
And why is the cursor red? Red is usually a warning color. How about a more neutral blue?
Comment 8 Robin Stocker CLA 2013-05-21 08:13:36 EDT
Created attachment 231247 [details]
tooltip for renamed files

> > > * It would be nice if one could see the old name in the table. Maybe it
> > > could be added at the end, something like "foo.txt (renamed from bar.txt)"?
> > > Or as a tooltip?
> > 
> > Tooltip or gittish style path/{added/}name. Doing this nicely, along with
> > the names in the compare UI, requires a lot more code and some thinking. The
> > patch I submitted is trivial in comparison. I suggest that is a future patch
> > (possible 3.0, but not necessarily).
> 
> I agree

Showing tooltip is actually pretty easy, I attached a patch (on top of patch set 3). I think we should include this for 3.0.
Comment 9 Robin Rosenberg CLA 2013-05-21 08:28:48 EDT
(In reply to comment #8)
> Created attachment 231247 [details]
> tooltip for renamed files

Something wrong with Gerrit? Make it a patch on top of mine.
Comment 10 Matthias Sohn CLA 2013-05-21 09:05:52 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > Looks better but still hard to read e.g. when overlayed to the Java source
> > file icon. I attached another proposal which I feel is a bit easier to read.
> 
> Looks better. Is there a specific reason it shows an "e"? Maybe an "r" (for
> rename) would be better?

e is a character which is still easy to read with a tiny font size, will try "r"

> And why is the cursor red? Red is usually a warning color. How about a more
> neutral blue?

I picked red since it's more easy to spot near the blue-ish "J" icon used for Java sources, will try other colors.
Comment 11 Robin Stocker CLA 2013-05-21 09:12:29 EDT
(In reply to comment #9)
> (In reply to comment #8)
> > Created attachment 231247 [details]
> > tooltip for renamed files
> 
> Something wrong with Gerrit? Make it a patch on top of mine.

No, just wasn't sure because there are other changes depending on it already. Done: https://git.eclipse.org/r/13019
Comment 12 Markus Keller CLA 2013-05-21 09:12:33 EDT
Created attachment 231252 [details]
smaller version of JDT's correction_rename.gif

In JDT UI, we sometimes use this arrow for quick fix proposals:
http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/plain/org.eclipse.jdt.ui/icons/full/obj16/correction_rename.gif

It is used e.g. when there's a spelling error in a comment or when a public class has a name that doesn't match the .java file name.

We currently only use this as object icon, but here's a smaller version that could also be used as an overlay.
Comment 13 Robin Stocker CLA 2013-05-21 12:22:12 EDT
(In reply to comment #12)
> Created attachment 231252 [details]
> smaller version of JDT's correction_rename.gif

I like it, because it's an arrow and visually simple. What I'm not sure about is the color, it's a lighter green than the "added" overlay (+). Maybe it should be the same green, or another color to increase the difference (blue, yellow)?
Comment 14 Markus Keller CLA 2013-05-21 13:58:14 EDT
Created attachment 231269 [details]
staged_added_lighter.gif

Yeah, the staged_added.gif is a bit dark, also if you compare it to the add.gif icon. When I squash add.gif, then I get this version, which doesn't use exactly the same colors as comment 12, but IMO blends in well and looks better than the original.
Comment 15 Matthias Sohn CLA 2013-05-21 19:36:45 EDT
(In reply to comment #12)
> Created attachment 231252 [details]
> smaller version of JDT's correction_rename.gif
> 
> In JDT UI, we sometimes use this arrow for quick fix proposals:
> http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/plain/org.eclipse.jdt.ui/
> icons/full/obj16/correction_rename.gif
> 
> It is used e.g. when there's a spelling error in a comment or when a public
> class has a name that doesn't match the .java file name.
> 
> We currently only use this as object icon, but here's a smaller version that
> could also be used as an overlay.

looks good to me, I'd leave the add overlay with the darker green then it's easier to differentiate it from the rename icon
Comment 16 Robin Rosenberg CLA 2013-05-22 17:38:05 EDT
(In reply to comment #12)
> Created attachment 231252 [details]
> smaller version of JDT's correction_rename.gif

My first reaction was: nooooo, but then I tried it and like it. Can we use it without CQ or something?
Comment 17 Matthias Sohn CLA 2013-05-22 18:51:30 EDT
(In reply to comment #16)
> (In reply to comment #12)
> > Created attachment 231252 [details]
> > smaller version of JDT's correction_rename.gif
> 
> My first reaction was: nooooo, but then I tried it and like it. Can we use
> it without CQ or something?

I think we can use it without CQ since it comes from JDT which is an Eclipse project as well and it's also licensed under EPL. According to the IP poster [1] reuse of Eclipse project which went through release review is ok.

[1] http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf
Comment 18 Markus Keller CLA 2013-05-23 07:12:06 EDT
Yes, it's completely IP-clean, including my manual shrinking to make it fit the 8x8 restriction for overlays.

And if it helps:
1. I authored 100% of this contribution
2. I have the rights to donate the content to Eclipse
3. I contribute the content under the EPL
4. Bad processes make me mad, see https://bugs.eclipse.org/381105
Comment 19 Robin Rosenberg CLA 2013-05-23 14:43:05 EDT
Thanks, I ammended the patch
Comment 20 Matthias Sohn CLA 2013-05-23 16:33:25 EDT
merged as e3141e7f1c03b97a143ffbf4778ccbd577dcffb6 and 31cfaea7ff140e93133e47fd7f36750670261feb
Comment 21 Robin Stocker CLA 2013-05-24 11:34:06 EDT
Reopened because the following JGit change should also be merged for 3.0:

https://git.eclipse.org/r/12969

(Or am I the only one using the History view filtered to project/resource?)
Comment 22 Robin Rosenberg CLA 2013-05-24 18:04:11 EDT
> https://git.eclipse.org/r/12969

Merged