Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed GitExtensions.settings not applied on change #11720

Closed
astos-marcb opened this issue May 2, 2024 · 8 comments · Fixed by #11781
Closed

Distributed GitExtensions.settings not applied on change #11720

astos-marcb opened this issue May 2, 2024 · 8 comments · Fixed by #11781

Comments

@astos-marcb
Copy link
Contributor

Environment

  • GitExtensions version: 4.2.1.17611
  • GIT version: 2.45.0.windows.1
  • OS version: Microsoft Windows NT 10.0.19045.0
  • .NET version: 6.0.29

Issue description

When a distributed GitExtensions.settings at repo root is updated while GitExtensions is running, the changes are not applied.
This can be a fairly regular condition for branches with deviating build integrations.

Settings in working directory seem to only be applied during initial repo load (GitExtensions restart required).
Expectation would be to (at least) update settings from working directory after branch switch or on manual refresh.

Steps to reproduce

Change to different branch with deviating distributed GitExtensions.settings in repo top level.

Did this work in previous version of GitExtensions?

No response

Diagnostics

No response

@mstv
Copy link
Member

mstv commented May 2, 2024

Which settings are affected?

@astos-marcb
Copy link
Contributor Author

astos-marcb commented May 2, 2024

At least settings in:

  • Build server integration (Jenkins) and
  • Revision links.

Not immediately testable in all other settings that support this level (GitExtensions/Detailed, Plugins).
But at least the setting for Plugins/Plugin Manager is affected as well (not sure if this level even makes sense there 😄).

@mstv
Copy link
Member

mstv commented May 2, 2024

Revision links.

Not reproducible. These settings are applied on repo switch.

Plugins

... are not my specialty.

@astos-marcb
Copy link
Contributor Author

This concerns different braches and file content in the same repository location.
Cached internal state seems to include distributed GitExtensions.settings file (per repo) and never refreshed during runtime.

Having a matching cached entry in GitExtSettingsCache is likely responsible for hiding content changes.
At least distributed settings would need to be invalidated on manual refresh or when a branch change is detected.

@mstv
Copy link
Member

mstv commented Jun 2, 2024

GitExtensions restart required

This is not necessary. There are two workarounds:

  • manual: Reopen the current repo, e.g. by selecting it again in the toolbar:

    image

  • event script: Create a non-background script (those trigger a refresh after their execution)

    image

When testing this, I noticed that these workarounds are not necessary - at least for:

  • revision links (URL changed in LinkFormats.GitExtLinkFormat.Format)
  • build server integration (BuildServer.EnableIntegration = true/false)

So, which dedicated settings do you vary in different branches?
Do the workarounds help?

@mstv mstv added 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity and removed 👓 status: needs review labels Jun 2, 2024
@astos-marcb
Copy link
Contributor Author

I do switch configuration of revision links in branches. ☺

But the condition to reproduce an issue has turned out to be more tricky than I thought;
Only one of of my branches had a GitExtensions.settings file!

  • When starting up (initial load) of the branch without a settings file, no updates are triggered for that repo ever
  • When started with and switching between branches that both have a settings file, everything works as expected
  • When switching from a branch with a file to one without, the settings do not get cleared.

Thanks @mstv to getting back to me so I could get to the bottom of this. 😄
My guess is you tried variant 2, while I always managed to trigger 1 and/or 3 (up to my latest trials).

While the workarounds do not make a difference in the pathological states/changes, they are (of course) also not required in condition 2 (everythin is fine) here.
Interestingly, in any condition the expected state is shown correctly in Settings.
But it does not get applied in the commit graph or info views in the described problematic states and transitions.

@mstv mstv added status: reproducible 👓 status: needs review and removed 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity labels Jun 2, 2024
@mstv
Copy link
Member

mstv commented Jun 4, 2024

@astos-marcb
Copy link
Contributor Author

astos-marcb commented Jun 4, 2024

The change seems to remedy condition 1), since now event handling is always registered as per the patch.
However, when going to a branch without a file in 3), the settings still do not get cleared.

It seems there is still further change required to properly handle a disappearing file. 🤔
_fileWatcher.Deleted += … and maybe even some further action in LoadImpl (far off my area of expertise!)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants