Bug 429899 - [History View] - Set Link with Editor and Selection as default
Summary: [History View] - Set Link with Editor and Selection as default
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 4.9 RC1   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on: 485743
Blocks:
  Show dependency tree
 
Reported: 2014-03-07 12:44 EST by Lars Vogel CLA
Modified: 2018-08-24 10:34 EDT (History)
8 users (show)

See Also:


Attachments
Anim Gif: History autosync is quite responsive on a PC with SSD (2.35 MB, image/gif)
2016-04-15 10:59 EDT, Patrik Suzzi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2014-03-07 12:44:17 EST
I think we should customize the Eclipse SDK so that the History View is automatically synchronized with the current selection. 

I have several times seen people (including myself) wondering over the empty History View. Maybe we can change that preference setting in our Eclipse SDK build and ask to do EPP the same? 

Opinions?
Comment 1 Lars Vogel CLA 2014-03-17 13:34:58 EDT
We just discussed that on EclipseCon in our Git/Gerrit and the overall feedback was that this should be the default setting.
Comment 2 Lars Vogel CLA 2014-03-17 13:38:26 EDT
Dani, sorry can't find team in https://projects.eclipse.org/projects/eclipse.platform but I think you are responsible for this project. 

Would you be in favor of setting this as default?
Comment 3 Lars Vogel CLA 2014-04-28 13:27:30 EDT
Dani, are you the component lead for team?
Comment 4 Dani Megert CLA 2014-04-28 14:04:04 EDT
This could have high performance impact based on the team provider.

We can either close as WONTFIX or have a closer look during 4.5.
Comment 5 Lars Vogel CLA 2014-04-28 16:56:08 EDT
Marking as WONTFIX for Luna, if required I open a new bug for Mars
Comment 6 Szymon Ptaszkiewicz CLA 2014-05-15 02:36:18 EDT
(In reply to Lars Vogel from comment #5)
> Marking as WONTFIX for Luna, if required I open a new bug for Mars

No need to create a new bug, you can reopen this one if needed.
Comment 7 Lars Vogel CLA 2016-04-11 17:36:14 EDT
In Platform UI Andrey fixed the update of the History view if it is not visible. See https://git.eclipse.org/r/#/c/67089/

With that, I think we should make the "Link with Editor and Selection" the default.

Background: I delivering a EGit training this week and the "why is my History view" empty is the most frequently question. I think changing the default here, will help new developers to use the History with less issues, while experience developers will know where to change this.
Comment 8 Lars Vogel CLA 2016-04-11 17:37:07 EDT
Matthias/ Andrey, any input from the EGit team on this?
Comment 9 Matthias Sohn CLA 2016-04-11 18:37:18 EDT
From a usability perspective this would make a lot of sense. It could affect performance but nowadays EGit is pretty fast also on large repositories.
I think I always switch this linking on hence +1 from me
Comment 10 Andrey Loskutov CLA 2016-04-12 01:24:27 EDT
(In reply to Lars Vogel from comment #8)
> Matthias/ Andrey, any input from the EGit team on this?

I have it always on and even with our monster repo I see no performance issues (on Eclipse 3.8). We should enable it if the platform version is >= 4.6, since earlier 4.x would cause unexpected refreshes.
Comment 11 Matthias Sohn CLA 2016-04-12 02:42:40 EDT
ok, so looks like we have agreement to switch linking on by default if the team provider is EGit, don't know for other team providers (see Dani's comment 4)
Comment 12 Dani Megert CLA 2016-04-13 08:07:22 EDT
(In reply to Matthias Sohn from comment #11)
> ok, so looks like we have agreement to switch linking on by default if the
> team provider is EGit, don't know for other team providers (see Dani's
> comment 4)

There's only one setting for the view (doesn't depend on the provider).

Personally I also have it enabled, but I heard from people not having an SSD, that the History view updating can badly slow down the whole machine while (E)Git provides the input for the history. Is anyone on this bug not using an SSD and can comment on that?
Comment 13 Matthias Sohn CLA 2016-04-13 08:43:05 EDT
(In reply to Dani Megert from comment #12)
> (In reply to Matthias Sohn from comment #11)
> > ok, so looks like we have agreement to switch linking on by default if the
> > team provider is EGit, don't know for other team providers (see Dani's
> > comment 4)
> 
> There's only one setting for the view (doesn't depend on the provider).
> 
> Personally I also have it enabled, but I heard from people not having an
> SSD, that the History view updating can badly slow down the whole machine
> while (E)Git provides the input for the history. Is anyone on this bug not
> using an SSD and can comment on that?

If the find toolbar isn't shown (which is the default) EGit's history view loads the history incrementally in chunks of 256 commits. In addition there is a limit to not show more than 10k commits (preference "Team > Git > History > Max number of commits to show"). For large repositories the WindowCache limit (preference "Team > Git > Window Cache > Window Cache limit") is probably too small, increasing that should avoid repeated loading of the same objects from disk.
Comment 14 Matthias Sohn CLA 2016-04-13 08:48:14 EDT
if we have someone who can reproduce this slowness they can use tracing to trace the history view:

- type "trace" in quick access and select "Configure Git Debug Trace"
- enable trace for plug-in org.eclipse.egit.ui
- enable trace "/debug/ui/historyview"

then repeat the slow operations and post the trace here
Comment 15 Lars Vogel CLA 2016-04-15 05:35:21 EDT
(In reply to Dani Megert from comment #12)
> Personally I also have it enabled, but I heard from people not having an
> SSD, that the History view updating can badly slow down the whole machine
> while (E)Git provides the input for the history. Is anyone on this bug not
> using an SSD and can comment on that?

I used a older laptop without SSD. Eclipse starts ultra slow (oh boy) and with this laptop everything was slower. But the History view sync setting did not create any (for me observable) slower interaction.
Comment 16 Patrik Suzzi CLA 2016-04-15 08:16:58 EDT
History synced with the selection a great idea as its performances are good now. 
Also, the History View should be visible by default in SDK, so more people can understand and use it.

IIUC, this bug mentions two items:
1. Link the HistoryView with the selection 
2. add the feature containing History View to EPP packages for SDK

In reply to Lars Vogel from comment #0)
> I think we should customise the Eclipse SDK so that the History View is
> automatically synchronised with the current selection. 

The sync itself can be performed via injection

@Inject
@Optional
void selectionChanged(
		@Named(IServiceConstants.ACTIVE_SELECTION) Object selection) {
	if(selection==null)
		return;
	this.selection = selection;
	// perform the sync
	synchronizeHistoryWithSelection();
}

> I have several times seen people (including myself) wondering over the empty
> History View. Maybe we can change that preference setting in our Eclipse SDK
> build and ask to do EPP the same? 

Is it just a preference, a setting to enable? - 
If so, the behaviour above is already implemented somewhere and we have just to set a flag; where? 

> Opinions?

In case we find cases in which objects are slow to be rendered in History, (w.r.t. Dani's comment 12), we could intercept them in the "selection changed", and render them gracefully.
Comment 17 Lars Vogel CLA 2016-04-15 08:40:00 EDT
(In reply to Patrik Suzzi from comment #16)
> History synced with the selection a great idea as its performances are good
> now. 
> Also, the History View should be visible by default in SDK, so more people
> can understand and use it.
> 
> IIUC, this bug mentions two items:

Sounds you misunderstood the scope. The sync is already where, you just need to change the default. Also History view is already part of all (relevent) EPPs.

The changes needs to be done in GenericHistoryView. Have a look at the
setLinkingEnabled method and how it gets its default.
Comment 18 Patrik Suzzi CLA 2016-04-15 10:37:48 EDT
(In reply to Lars Vogel from comment #17)
> The changes needs to be done in GenericHistoryView. Have a look at the
> setLinkingEnabled method and how it gets its default.

Ok, thanks, now I understand. 

I observed GenericHistoryView#setLinkingEnabled(), and we use the property:
IFileHistoryConstants.PREF_GENERIC_HISTORYVIEW_EDITOR_LINKING 

I'm going to set the default in TeamUIPlugin#initializeDefaultPluginPreferences()
so GenericHistoryView#createPartControl() will be initialized by the default.
Comment 19 Lars Vogel CLA 2016-04-15 10:43:55 EDT
(In reply to Patrik Suzzi from comment #18)
> (In reply to Lars Vogel from comment #17)
> > The changes needs to be done in GenericHistoryView. Have a look at the
> > setLinkingEnabled method and how it gets its default.
> 
> Ok, thanks, now I understand. 
> 
> I observed GenericHistoryView#setLinkingEnabled(), and we use the property:
> IFileHistoryConstants.PREF_GENERIC_HISTORYVIEW_EDITOR_LINKING 
> 
> I'm going to set the default in
> TeamUIPlugin#initializeDefaultPluginPreferences()
> so GenericHistoryView#createPartControl() will be initialized by the default.

Sounds good, please ensure that it works for the Git team provider. As it is a global setting, it should in this case also work for other team providers.
Comment 20 Eclipse Genie CLA 2016-04-15 10:45:09 EDT
New Gerrit change created: https://git.eclipse.org/r/70764
Comment 21 Patrik Suzzi CLA 2016-04-15 10:59:53 EDT
Created attachment 260988 [details]
Anim Gif: History autosync is quite responsive on a PC with SSD

I did some test and it seems quite responsive. 
It just lags a bit the first time you select a repository
Comment 22 Sergey Prigogin CLA 2016-04-16 02:19:06 EDT
(In reply to Patrik Suzzi from comment #21)

History view performance is very dependent on the type of the provider and for providers that have to query a remote server is dependent on how fast or slow that server is. Flipping the default may have a significant negative performance impact on some users. I'm not sure if this is justified by some additional convenience for EGit users. Should this preference be flipped for EGit users only?
Comment 23 Patrik Suzzi CLA 2016-04-16 04:10:27 EDT
(In reply to Sergey Prigogin from comment #22)

Currently, it is a global setting, and it uses a single boolean preference and a single button on the UI to activate/deactivate. 

If we differentiate per provider, we might need to introduce new boolean preferences, and maybe a button with a drop-down menu listing the known providers. 

Please, see this image as an example: http://i.imgur.com/5nSLAuR.png

If we can not agree on a solution here, on this bug, I suggest opening a new linked bug to track the Idea.
Comment 24 Lars Vogel CLA 2016-04-16 04:58:57 EDT
Sergey, is this a general concern or can you observe performance problems with your team provider (perforce?) and this setting?
Comment 25 Sergey Prigogin CLA 2016-04-16 12:26:12 EDT
(In reply to Lars Vogel from comment #24)

Haven't tried it with my provider (Piper - https://youtu.be/W71BTkUbdqE) yet, but I know that retrieving history isn't particularly fast whenever a server call is involved.
Comment 26 Lars Vogel CLA 2016-04-18 04:16:27 EDT
(In reply to Sergey Prigogin from comment #25)
> (In reply to Lars Vogel from comment #24)
> 
> Haven't tried it with my provider (Piper - https://youtu.be/W71BTkUbdqE)
> yet, but I know that retrieving history isn't particularly fast whenever a
> server call is involved.

Please update the bug with your test results, once you have the chance to try it out.
Comment 27 Andrey Loskutov CLA 2016-04-20 05:05:31 EDT
(In reply to Andrey Loskutov from comment #10)
> (In reply to Lars Vogel from comment #8)
> > Matthias/ Andrey, any input from the EGit team on this?
> 
> I have it always on and even with our monster repo I see no performance
> issues (on Eclipse 3.8). We should enable it if the platform version is >=
> 4.6, since earlier 4.x would cause unexpected refreshes.

I must correct me. Working with *multiple* repositories seems to be still an issue. See bug 485743 reported against EGit 4.2 (4.3 contains no changes in that area, so it is still valid).
Comment 28 Dani Megert CLA 2016-04-26 06:29:05 EDT
I suggest we put this on hold until bug 485743 is fixed.
Comment 29 Lars Vogel CLA 2018-06-19 04:41:59 EDT
(In reply to Dani Megert from comment #28)
> I suggest we put this on hold until bug 485743 is fixed.

EGit team started to work on it. Once Bug 485743 has been fixed, we should change the default.
Comment 30 Andrey Loskutov CLA 2018-07-17 07:09:22 EDT
(In reply to Lars Vogel from comment #29)
> (In reply to Dani Megert from comment #28)
> > I suggest we put this on hold until bug 485743 is fixed.
> 
> EGit team started to work on it. Once Bug 485743 has been fixed, we should
> change the default.

We've just merged the fix in EGit. Feel free to proceed here.
Comment 31 Lars Vogel CLA 2018-08-23 10:17:21 EDT
If no objections I would like to enable this in RC1.
Comment 33 Eclipse Genie CLA 2018-08-24 10:24:52 EDT
New Gerrit change created: https://git.eclipse.org/r/128033