Community
Participate
Working Groups
Except for CommitFileRevision which returns an author stored in org.eclipse.jgit.lib.PersonIdent, all other GitFileRevisions (IndexFileRevision, WorkingTreeFileRevision, WorkspaceFileRevision) return an empty string when asked for the author. See also bug 358392.
This is a major loss of function when coming from CVS: one no longer sees immediately who made the (incoming) change.
What should it be returning for [Index/WorkingTree/Workspace]FileRevision? If I look at org.eclipse.team.core.history.provider.LocalFileRevision it also returns "". Should it be null instead?
Created attachment 207703 [details] Picture showing the issue
(In reply to comment #2) > What should it be returning for [Index/WorkingTree/Workspace]FileRevision? > > If I look at org.eclipse.team.core.history.provider.LocalFileRevision it also > returns "". > > Should it be null instead? I can't comment on this bug, but it was my bug 358392 which triggered this one. it looks like "my bug" was simply to get rid of the NPE but not make the author appear. See attachment 207703 [details].
> it looks like "my bug" was simply to get rid of the NPE but not make the author > appear. What I meant, is that the other bug was fixed by suppressing the NPE only, instead of fixing the problem completely.
hmm, it's only the item that appear in a Git commit that has author information, unless you consider the file owner, for which I'm not aware of an API. For the workspace/index one could conceivably return the information from the last commmit iff there are no local changes, otherwise I think it should be empty. Kevins suggestion might be ok also. The null/emptyu string should be translated to "local user" or somethin in the UI.
(In reply to comment #6) > hmm, it's only the item that appear in a Git commit that has author > information, > unless you consider the file owner, for which I'm not aware of an API. In my attached picture you can see the remote hash, so I assume there is a way to get that author. > For the workspace/index one could conceivably return the information from > the last commmit iff there are no local changes, otherwise I think it > should be empty. > > Kevins suggestion might be ok also. The null/emptyu string should be > translated to "local user" or somethin in the UI. No, this adds no value. I know that I changed the file. What I'd like to see is the author of the revision that I changed (often this is the same as the one on the right side, but not always, e.g. if the file already changed on the remote master).
(In reply to comment #7) > (In reply to comment #6) > > hmm, it's only the item that appear in a Git commit that has author > > information, > > unless you consider the file owner, for which I'm not aware of an API. > > In my attached picture you can see the remote hash, so I assume there is a > way to get that author. so you mean the right hand side of the compare editor which doesn't show the author but should show it? I tried this using "Compare With > HEAD revision" and EGit displays the author of the HEAD revision in the right hand pane of the compare editor. But the file displayed wasn't changed in the commit HEAD points at but in an earlier commit, but still EGit shows the author of HEAD commit which seems wrong since this isn't the author who last changed the file content displayed there. Same behavior when my local change is staged and I double click it in the staging view. If it's not yet staged and I double click in "unstaged" pane of the staging view no author is displayed since then the right hand side represents the index state which has no author information on its own. Though as long as index and HEAD are identical we could show the author of the most recent commit who touched this file.
(In reply to comment #8) > (In reply to comment #7) > > (In reply to comment #6) > > > hmm, it's only the item that appear in a Git commit that has author > > > information, > > > unless you consider the file owner, for which I'm not aware of an API. > > > > In my attached picture you can see the remote hash, so I assume there is a > > way to get that author. > > so you mean the right hand side of the compare editor which doesn't show the > author but should show it? > > I tried this using "Compare With > HEAD revision" and EGit displays the > author of the HEAD revision in the right hand pane of the compare editor. > But the file displayed wasn't changed in the commit HEAD points at but in an > earlier commit, but still EGit shows the author of HEAD commit which seems > wrong since this isn't the author who last changed the file content > displayed there. Could you review https://git.eclipse.org/r/#/c/7690/ ? The behavior is fixed there (see commit message).
fixed with http://git.eclipse.org/c/egit/egit.git/commit/?id=33108de73badd0f8fda83e29c4a2f23387fd7f88
Created attachment 222936 [details] Picture of the two Compare editors
This is still not fixed. I still do not see the author in the compare editor that is opened via Synchronize view. It works if I do Compare With > Latest from HEAD on the same file. See attachment 222936 [details] to see the difference.
(In reply to comment #12) > This is still not fixed. I still do not see the author in the compare editor > that is opened via Synchronize view. > > It works if I do Compare With > Latest from HEAD on the same file. See > attachment 222936 [details] to see the difference. To clarify the picture: I would at least expect to see the author for the remote file in the left picture.
Could you please add the steps to reproduce this? I couldn't locate where "Remote File" is coming from and couldn't find it when using the Synchronize view.
(In reply to comment #14) > Could you please add the steps to reproduce this? I couldn't locate where > "Remote File" is coming from and couldn't find it when using the Synchronize > view. 1. Change a shared file and save it 2. Select its project in the 'Package Explorer' 3. Team > Synchronize with Workspace 4. in the 'Synchronize' view double-click the file
Created attachment 222985 [details] Picture showing opened compare editor from synchronize (working tree) With these steps I get the attached result. The file is from below the <working tree> node, Eclipse 4.2.1. When I stage it and then open the compare editor, I get an NPE (the fix for that is in https://git.eclipse.org/r/#/c/7564/). Different settings?
(In reply to comment #16) > Created attachment 222985 [details] > Picture showing opened compare editor from synchronize (working tree) > > With these steps I get the attached result. The file is from below the > <working tree> node, Eclipse 4.2.1. > > When I stage it and then open the compare editor, I get an NPE (the fix for > that is in https://git.eclipse.org/r/#/c/7564/). > > Different settings? I don't know what you mean by working tree. Looks like more detailed steps from me are needed (I thought they should work).
(In reply to comment #17) > I don't know what you mean by working tree. Looks like more detailed steps > from me are needed (I thought they should work). Ah, now I found it! I had "Git Commits" as the selected model. With that, the root nodes are <working tree>, <staged changes> and then individual commits. When switching to "Workspace", I can now reproduce the compare editor with "Remote File" and no author.
Found the place thanks to EclEmma (coverage of running Eclipse), fix pushed to review: https://git.eclipse.org/r/8421
(In reply to comment #19) > Found the place thanks to EclEmma (coverage of running Eclipse), fix pushed > to review: > > https://git.eclipse.org/r/8421 Submitted as http://git.eclipse.org/c/egit/egit.git/commit/?id=b63344fc5727ecaf78de16f16bb5cc5f243bab48
Failing tests caused by the change: https://hudson.eclipse.org/sandbox/job/egit.gerrit/3507/
(In reply to comment #21) > Failing tests caused by the change: > > https://hudson.eclipse.org/sandbox/job/egit.gerrit/3507/ Fix pushed: https://git.eclipse.org/r/8423
Merged by Dani: http://git.eclipse.org/c/egit/egit.git/commit/?id=085b0499ce52ef603572e6788457a34d5293078f
Verified in 2.2.0.201210310023