Bug 383359 - indicate whether each file is modified, deleted, or renamed
Summary: indicate whether each file is modified, deleted, or renamed
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 95
: P2 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: Lei Zhu CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, helpwanted, noteworthy, plan
: 402782 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-06-22 18:54 EDT by Sam Davis CLA
Modified: 2013-05-12 23:36 EDT (History)
3 users (show)

See Also:


Attachments
wrong path shown (8.34 KB, image/png)
2013-03-15 16:56 EDT, Sam Davis CLA
no flags Details
copied files in Gerrit web ui (14.15 KB, image/png)
2013-04-16 19:45 EDT, Sam Davis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Davis CLA 2012-06-22 18:54:28 EDT
When viewing patch sets, the editor should indicate whether each file is modified, deleted, or renamed. The web UI does this and it's very useful.
Comment 1 Steffen Pingel CLA 2012-07-01 15:08:20 EDT
Agreed, that is currently missing and would be very useful to have. It should be reasonably straight forward to add that as a decoration on the icon in the list of files. For renames it could also help to have a tooltip that shows the previous filename.
Comment 2 Lei Zhu CLA 2013-01-01 15:17:09 EST
Hello Sam and Steffen, I started a review for this feature(?) here https://git.eclipse.org/r/#/c/9414/
Hope you've had a good new year!
Comment 3 Sam Davis CLA 2013-01-02 14:12:27 EST
Thanks Lei! It's great to see some progress on this.
Comment 4 Sam Davis CLA 2013-03-15 16:56:50 EDT
Created attachment 228504 [details]
wrong path shown

As highlighted in the screenshot, the new path is shown on the base revision of a renamed file. Can that be fixed as part of this?
Comment 5 Miles Parker CLA 2013-03-15 17:46:49 EDT
I'll defer to Lei, but personally I'd rather see all of the rename stuff a new task so that we can get these improvements in for EclipseCon demo. :)
Comment 6 Lei Zhu CLA 2013-03-15 18:02:45 EDT
Just to make sure I understand the screenshot, its supposed to say "com/tasktop/client/ui" on the highlighted part?
Also that doesn't look like the same part I'm working on so it might take a bit.
Comment 7 Miles Parker CLA 2013-03-15 19:30:15 EDT
(In reply to comment #6)
> Just to make sure I understand the screenshot, its supposed to say
> "com/tasktop/client/ui" on the highlighted part?
> Also that doesn't look like the same part I'm working on so it might take a bit.

Yeah, as I say, let's just go ahead and merge the current changes as is and work on the rename part afterward. We can hold this bug open rather than rename it. :) Okay?
Comment 8 Lei Zhu CLA 2013-03-15 19:47:46 EDT
Sounds fine to me.
Comment 9 Sam Davis CLA 2013-03-15 20:01:07 EDT
(In reply to comment #6)
> Just to make sure I understand the screenshot, its supposed to say
> "com/tasktop/client/ui" on the highlighted part?

That's right.
Comment 10 Lei Zhu CLA 2013-03-21 20:31:52 EDT
I will continue to work on the rename portion of this.
Comment 11 Steffen Pingel CLA 2013-03-22 10:09:36 EDT
Thanks for your contributions so far, Lei!
Comment 12 Sam Davis CLA 2013-03-22 14:14:29 EDT
Great work, Lei!
Comment 13 Lei Zhu CLA 2013-03-24 20:02:51 EDT
Thank you :D
Comment 14 Steffen Pingel CLA 2013-04-02 09:26:29 EDT
*** Bug 402782 has been marked as a duplicate of this bug. ***
Comment 15 Sam Davis CLA 2013-04-02 16:13:30 EDT
This a small thing, but we should consider not decorating /COMMIT_MSG with a + as it doesn't really make sense.
Comment 16 Sebastien Dubois CLA 2013-04-03 15:19:13 EDT
(In reply to comment #15)
> This a small thing, but we should consider not decorating /COMMIT_MSG with a
> + as it doesn't really make sense.

Additionally, the file icon should also be decorated when it has been reviewed using a little checkmark, like the Gerrit WebUI does.
Comment 17 Sam Davis CLA 2013-04-03 16:45:31 EDT
What determines whether a file has been reviewed? For me, just opening a file doesn't mean I've reviewed it. If this status is going to be shown, I would want to be able to mark a file as reviewed or not reviewed, like you can in the Gerrit WebUI.
Comment 18 Sebastien Dubois CLA 2013-04-03 16:58:11 EDT
(In reply to comment #17)
> What determines whether a file has been reviewed? For me, just opening a
> file doesn't mean I've reviewed it. If this status is going to be shown, I
> would want to be able to mark a file as reviewed or not reviewed, like you
> can in the Gerrit WebUI.

When using the Gerrit webUI, opening the file shows a checkbox that is used to mark the file as reviewed.  Similarly, in R4E, we provide a contextual command on the file icon in the R4E Review Navigator to the user that can be used to manually mark the file as reviewed.

According to how the editor works in eclipse, we could either provide an compare editor contextual menu item checkbox to mark the file as reviewed, or use a contextual menu in the Gerrit task editor/Review navigator icon in a similar way R4E does it.  Or both.
Comment 19 Lei Zhu CLA 2013-04-06 01:01:53 EDT
https://git.eclipse.org/r/#/c/11699/
started here.
Comment 20 Sam Davis CLA 2013-04-16 18:31:26 EDT
Should we also indicate copied files like the web ui does?
Comment 21 Miles Parker CLA 2013-04-16 18:51:20 EDT
Sure. But I've never actually noticed that.. Do you have an example review?
Comment 22 Miles Parker CLA 2013-04-16 18:59:23 EDT
I just looked at the review again and re: our comments about hard-code string. This might be overkill, but I'm wondering if we should having all of the logic for this in the model. We'd add a ChangeType enum attribute to IFileItem and process it at retrieval time -- this would also allow us to take care of the special case where COMMIT_MESSAGE isn't counter as an "Add".

https://git.eclipse.org/r/#/c/11699/1/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/providers/ReviewsLabelProvider.java
Comment 23 Sam Davis CLA 2013-04-16 19:44:44 EDT
That makes sense to me. 

(In reply to comment #21)
> Sure. But I've never actually noticed that.. Do you have an example review?
I only just noticed it myself, which is why I posted. I don't have a public example, but I'll post a screenshot.
Comment 24 Sam Davis CLA 2013-04-16 19:45:37 EDT
Created attachment 229782 [details]
copied files in Gerrit web ui
Comment 25 Miles Parker CLA 2013-04-16 19:55:52 EDT
Wow, I wonder how they even detect that and what we'd check in the file item to infer it? My inclination is to say this is sort of an edge case that we can safely ignore but OTOH if we do this in model it would be an important case to at least represent.

Thanks for pointing this one out, Sam!
Comment 26 Miles Parker CLA 2013-04-16 19:59:49 EDT
BTW, I had one other thought about all of this. We're assuming like Gerrit assumes that all files under review actually *have* changed in some way. (The commit message seems to sort of a special case in Gerrit.) In fact with R4E and perhaps other review systems, you might add items into a ReviewSet that haven't been modified at all.

How would you represent that? Sebastien, and thoughts?
Comment 27 Sebastien Dubois CLA 2013-04-17 11:15:45 EDT
(In reply to comment #26)
> BTW, I had one other thought about all of this. We're assuming like Gerrit
> assumes that all files under review actually *have* changed in some way.
> (The commit message seems to sort of a special case in Gerrit.) In fact with
> R4E and perhaps other review systems, you might add items into a ReviewSet
> that haven't been modified at all.
> 
> How would you represent that? Sebastien, and thoughts?

Basically, in R4E you can manually add files to a given review.  However R4E does not work like Gerrit because the review creator has to add the review content manually anyways, whereas in Gerrit a Review is always linked to a specific "change" and this change is automatically included with its parent review at creation.

In R4E adding manually a file assumes that the "change" is actually the whole file.  You can also add specific parts of files.  However this is a moot point in Gerrit.

Now for the copied files in Gerrit, we'll have to see how it does that.  If this information is included or can be inferred from the Gerrit model data, then we could represent it as well.  We could use a decoration on the file icon, add content to tooltip etc.  

I think that this should be tackled as a separate effort i.e. write another bug for this.  This one is getting crowdy.
Comment 28 Sam Davis CLA 2013-04-17 12:34:05 EDT
I guess Gerrit must infer copying based on file content (or perhaps a hash of the content). I don't know if it considers a file copied if you copy it and then change one byte. If this is available in the model, it could be useful to show it using a small version of the standard copy icon. It is an unusual case and may represent a mistake (i.e. maybe the copy should have been a move).

As for unchanged files, perhaps they could be decorated with the glasses icon or similar to indicate that they have been explicitly added, but it sounds like this might not make sense in R4E and it isn't supported in Gerrit, so maybe that case can be ignored for now.
Comment 29 Miles Parker CLA 2013-04-17 12:55:55 EDT
(In reply to comment #28)

> As for unchanged files, perhaps they could be decorated with the glasses icon or

That's a nice idea. In any case, I agree that we should hold on this one.

What about idea of pushing this to model?
Comment 30 Sam Davis CLA 2013-04-17 14:08:00 EDT
+1
Comment 31 Lei Zhu CLA 2013-05-07 23:42:38 EDT
I think I am going to start to work on the other features that Sebastien mentioned, some hints are appreciated (:
Comment 32 Steffen Pingel CLA 2013-05-08 04:15:04 EDT
Lei, can you summarize what is left to do? I would suggest that we open a separate bug for decorating and managing files that have been reviewed. This will possibly require model changes and back-end communication to communicate which files have been reviewed back to Gerrit.

Thanks very much for your great contributions so far!
Comment 33 Lei Zhu CLA 2013-05-08 17:20:05 EDT
Thank you Steffen (:

I think what is left to do is:
* remove graphic decoration from commit messages
* Decorate file icons with a checkmark when it has been reviewed like in the Gerrit web-ui

All of Sam's original suggestions are finished I think.
Comment 34 Steffen Pingel CLA 2013-05-08 22:46:03 EDT
(In reply to comment #33)
> I think what is left to do is:
> * remove graphic decoration from commit messages

That makes sense. Do you already have an idea how to implement that?

> * Decorate file icons with a checkmark when it has been reviewed like in the
> Gerrit web-ui

Unless there is an easy way to do this with the current model let's defer that to a separate bug.
Comment 35 Lei Zhu CLA 2013-05-08 23:16:04 EDT
Good morning Steffen!

For the first, I tried by checking if the image being retrieved was for the commit message in the getImage method with a hard-coded String, and I think Miles said to defer that to the bug. For the second one, I am not sure.
Comment 36 Steffen Pingel CLA 2013-05-08 23:24:10 EDT
(In reply to comment #35)
> Good morning Steffen!
> 
> For the first, I tried by checking if the image being retrieved was for the
> commit message in the getImage method with a hard-coded String, and I think
> Miles said to defer that to the bug.

Thanks, just found the conversation in comment #22 :).

> We'd add a ChangeType enum attribute to IFileItem and
> process it at retrieval time -- this would also allow us to take care of the
> special case where COMMIT_MESSAGE isn't counter as an "Add".

That makes sense to me. Miles, is that something you could do?
Comment 37 Sebastien Dubois CLA 2013-05-08 23:24:38 EDT
(In reply to comment #34)
> (In reply to comment #33)
> > I think what is left to do is:
> > * remove graphic decoration from commit messages
> 
> That makes sense. Do you already have an idea how to implement that?
> 
> > * Decorate file icons with a checkmark when it has been reviewed like in the
> > Gerrit web-ui
> 
> Unless there is an easy way to do this with the current model let's defer
> that to a separate bug.

I agree with Steffen.  For the reviewed file issue, a separate bug should be filed
Comment 38 Miles Parker CLA 2013-05-09 12:51:54 EDT
(In reply to comment #36)
> > For the first, I tried by checking if the image being retrieved was for the
> > commit message in the getImage method with a hard-coded String, and I think
> > Miles said to defer that to the bug.
> 
> Thanks, just found the conversation in comment #22 :).
> 
> > We'd add a ChangeType enum attribute to IFileItem and
> > process it at retrieval time -- this would also allow us to take care of the
> > special case where COMMIT_MESSAGE isn't counter as an "Add".
> That makes sense to me. Miles, is that something you could do?

> I agree with Steffen.  For the reviewed file issue, a separate bug should be
> filed

There are a number of things we could do to enhance the model to support user cues like this. Another one if to differentiate between "humans" and "bots" for messages and to identify the user to support providing a Yellow icon. But yes, these should all go ina s eperate bug, like "enhance model to support user interface" or something..
Comment 39 Steffen Pingel CLA 2013-05-09 13:09:20 EDT
(In reply to comment #38)
> There are a number of things we could do to enhance the model to support user
> cues like this. Another one if to differentiate between "humans" and "bots" for
> messages and to identify the user to support providing a Yellow icon. But yes,
> these should all go ina s eperate bug, like "enhance model to support user
> interface" or something..

I was more thinking along a modification type for each file as you suggested, e.g.: ModificationType { Added, Modified, Deleted, Unchanged }.
Comment 40 Sam Davis CLA 2013-05-09 13:22:54 EDT
ModificationType { Added, Modified, Deleted, Renamed, Unchanged }.
Comment 41 Miles Parker CLA 2013-05-09 13:23:39 EDT
(In reply to comment #39)
> I was more thinking along a modification type for each file as you suggested,
> e.g.: ModificationType { Added, Modified, Deleted, Unchanged }.

Right, that would nicely simplify the code. I'm just suggesting we could wrap all of these model changes together.
Comment 42 Steffen Pingel CLA 2013-05-09 14:15:52 EDT
(In reply to comment #41)
> (In reply to comment #39)
> > I was more thinking along a modification type for each file as you suggested,
> > e.g.: ModificationType { Added, Modified, Deleted, Unchanged }.
> 
> Right, that would nicely simplify the code. I'm just suggesting we could wrap
> all of these model changes together.

The reason I'm suggesting to make this change now is because it's simple. Gerrit's Patch.getChangeType() method already returns exactly what we are looking for:  ChangeType { ADDED, MODIFIED, DELETED, RENAMED, COPIED }. It should be straight forward to set that on the model.
Comment 43 Miles Parker CLA 2013-05-09 14:35:46 EDT
(In reply to comment #42)
> (In reply to comment #41)
> > (In reply to comment #39)
> > > I was more thinking along a modification type for each file as you
> suggested,
> > > e.g.: ModificationType { Added, Modified, Deleted, Unchanged }.
> >
> > Right, that would nicely simplify the code. I'm just suggesting we could wrap
> > all of these model changes together.
> 
> The reason I'm suggesting to make this change now is because it's simple.
> Gerrit's Patch.getChangeType() method already returns exactly what we are
> looking for:  ChangeType { ADDED, MODIFIED, DELETED, RENAMED, COPIED }. It
> should be straight forward to set that on the model.

Yes, we should do that no question. My priority right now is getting the persistence stuff finished for RC1. If I can, I'll squeeze a quick change in for these before then. Basically, I'd like to get all of the model changes in at once as it is much simpler to bundle them up together. We don't have to do the UI side in the same change.
Comment 44 Lei Zhu CLA 2013-05-12 23:36:04 EDT
Since Sam's original suggestions are completed, I am now going to resolve this as closed, and I've made a new Task: bug 407836