Revision links use stale remote data after switching repositories/submodules
Author: inuikCreated Aug 24, 2026Updated Sep 19, 2026
Labelsneeds-area-label
Environment
GitExtensions version: 7.0.1.86
GIT version: 2.55.windows.3
OS version: Microsoft Windows NT 10.0.26200.0
.NET version: 10.0.11
GitExtensions component: Revision Links (External links / CommitInfo)
Relevant files:
- src/app/GitCommands/ExternalLinks/ExternalLinkRevisionParser.cs
- src/app/GitCommands/ExternalLinks/ExternalLinkFormat.cs
- src/app/GitUI/CommitInfo/CommitInfo.cs
- src/app/GitCommands/Remotes/ConfigFileRemoteSettingsManager.cs
Issue description
When clicking a revision link after switching between different cloned repositories or submodules (within the same running GitExtensions instance), the link sometimes opens a URL that belongs to the previously-opened repository instead of using the remotes for the repository currently displayed in Commit Info. This appears to be caused by revision-link generation using stale/cached remote data or a parser state tied to a previous IGitModule instance.
Observed consequences:
- The opened URL points to another repo (an earlier repo/module), not the repo whose commit is shown.
- This is reproducible without restarting GitExtensions by switching repo contexts in the same app window.
Steps to reproduce
- Configure a Revision Link definition that generates an http(s) URL based on a remote (include SearchPattern / RemoteSearchPattern / Format in the rule).
- Open repository A (or open a submodule A) in GitExtensions.
- Open Commit Info for a commit in repo A that matches the rule; click the generated link and note the opened URL.
- In the same GitExtensions instance, switch to repository B (or open a different submodule).
- Open Commit Info for a commit in repo B that should generate a different URL under the same rule; click the generated link.
- Observe that the URL that opens is still the one from repository A.
Did this work in previous version of GitExtensions?
Unknown
Diagnostics
- Related existing issues (may be relevant but do not describe this exact symptom): #5409, #9668, #3763, #2714, #2768, #4404.
- Suspected root causes:
- ExternalLinkRevisionParser.ParseRemotes or its upstream remotes manager is using a stale IGitModule or cached remotes between Parse calls.
- ExternalLinkFormat.Apply may be involved if formatting manipulations cause unexpected aliasing, but primary suspicion is stale remoteMatches or a parser instance tied to the wrong Module.
- Suggested immediate debug steps for maintainers:
- Add logging in ExternalLinkRevisionParser to print which IGitModule/repo path produced the remoteMatches and which remote/url was selected per Parse call.
- Confirm that the remotes are loaded from the current Module (e.g., pass IGitModule explicitly to Parse instead of relying on long-lived delegates or caches).
- If caching is needed, key caches by repository path/Module to prevent cross-repo reuse.
- Add a test exercising two Module contexts in-process to prevent regressions.
Source: gitextensions/gitextensions