NEW DATE! Bugzilla will undergo maintenance 2024-03-28 18h00 CET. Bugzilla will be placed in read-only mode at that time.

Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 433073 - Blame annotations are not refreshed after a checkout
Summary: Blame annotations are not refreshed after a checkout
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 5.13   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-18 08:28 EDT by Marc Khouzam CLA
Modified: 2021-08-15 18:03 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2014-04-18 08:28:10 EDT
When blame annotations are displayed and I perform a checkout of another branch, the annotations are not refreshed.  This causes the old annotation information to be shown for the newly checked-out code, which is incorrect.

Wither forcing a refresh of the annotations or hiding them seem fine.  Maybe a refresh would be too expensive if annotations are shown in many editors?
Comment 1 Thomas Wolf CLA 2021-07-29 17:33:37 EDT
Also happens when the file is changed, saved, and then committed: blame annotations are not updated.

It appears that the revision ruler framework in JFace (RevisionInformation/RevisionPainter/AbstractDecoratedTextEditor) is built around the assumption that no such automatic occurs. Instead the user is supposed to hide the revision annotations manually, or to refresh them manually by invoking "Show Revision Information" again.

This is also the reason why this is not a toggle (compare bug 454476) and also why it is still visible/enabled when revisions are already shown (bug 505939).

See also bug 274691 comment 6.

I see no readily apparent way to subvert the current framework infrastructure to automatically refresh this revision information when HEAD changes. Would need to be able to add a RefsChangedListener on the repo (looks probably doable) and trigger a refresh when HEAD changes, but then also be able to remove it when either the revision information is hidden or the editor is closed (looks difficult). And a refresh should be triggered only for visible editors; invisible editors with revision info enabled should instead check HEAD when activated and if it changed do the refresh then.

If it is doable, it is certainly not trivial.
Comment 2 Eclipse Genie CLA 2021-07-30 09:25:48 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/183552
Comment 3 Eclipse Genie CLA 2021-08-15 15:28:44 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/184034