Bug 551582 - history input is set twice with "show first parent" enabled
Summary: history input is set twice with "show first parent" enabled
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 5.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 5.6   Edit
Assignee: Tim Neumann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-28 01:13 EDT by Michael Keppler CLA
Modified: 2019-10-01 17:17 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Keppler CLA 2019-09-28 01:13:58 EDT
When "show first parent only" is enabled, the history view input is set twice all the time (as I can even see by 2 jobs in progress view) on changing the git repository view selection. The additional call comes from the last line of org.eclipse.egit.ui.internal.history.GitHistoryPage.GitHistoryPageActions.ShowFirstParentOnlyPrefAction.propertyChange(PropertyChangeEvent)

That is part of the "repository specific setting" from that contribution, where we discussed already a lot during the contribution. I'm in favor of removing that, and to only have a single global preference for that button.
Comment 1 Tim Neumann CLA 2019-09-30 03:50:39 EDT
You are right. That contribution causes a refresh directly after the repository is switched (both repository switch itself and refresh cause the input to be set).
And actually this should always be the case no matter if "show first parent only" is enabled.

The repository specific setting was specifically requested during development of that feature, so I'd suggest keeping that.

I'd rather try to remove the double refresh by more intelligent handling of a repository switch. (Either compute the "first parent only" state during the initial switch to avoid having to refresh it later or suppress the refresh for the initial repository switch as we know the refresh will happen a few moments later after the "first parent only" state is computed.

I can work on a contribution for that after I'm finished with https://bugs.eclipse.org/bugs/show_bug.cgi?id=381520
Comment 2 Michael Keppler CLA 2019-09-30 12:25:22 EDT
Thomas, could we make that flag part of the HistoryPageInput and return early in GitHistoryPage, if the new input is equal to the current input? That would avoid the duplicate refresh, even if the input is set multiple times.

However, right now we only check for identity (not equality) at GitHistoryPage,2116. I vaguely remember some discussion in gerrit to change that to equality???
Comment 3 Eclipse Genie CLA 2019-10-01 07:03:27 EDT
New Gerrit change created: https://git.eclipse.org/r/150428
Comment 4 Eclipse Genie CLA 2019-10-01 08:18:56 EDT
Gerrit change https://git.eclipse.org/r/150428 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=7b6eb9c6d16884eb2f98d450ed7bf8af1104655c