-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Git config #12201
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
Git config #12201
Conversation
db9f16c
to
f1bc5c2
Compare
and declare EffectiveConfigFile read-only & private and fixup signature of IGitModule.PullCmd Refs: gitextensions#12201
because it brings insignificant speedup in its current form Refs: gitextensions#12201
and use factory method Refs: gitextensions#12201
and SetGitSetting over using LocalConfigFile Refs: gitextensions#12201
with EffectiveGitConfigSettings and remove IGitModule.GetGitSetting & GetEffectiveGitSetting Refs: gitextensions#12201
with GitConfigSettings Refs: gitextensions#12201
as replacement for IConfigFileSettings.GetValues Refs: gitextensions#12201
using extended IGitConfigSettingsGetter Refs: gitextensions#12201
with GetAllLocalSettings & SetSetting Refs: gitextensions#12201
including implementation Refs: gitextensions#12201
b3e54f1
to
daa8a0d
Compare
b1e055c
to
1473e00
Compare
and SetGitSetting over using LocalConfigFile Refs: gitextensions#12201
with GetAllLocalSettings & SetSetting Refs: gitextensions#12201
including implementation Refs: gitextensions#12201
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 36 out of 36 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
src/app/GitCommands/Settings/GitConfigSettings.cs:145
- The use of the null-forgiving operator on 'firstValue' assumes it is non-null. Consider adding a safeguard or verifying that 'firstValue' can never be null to avoid potential runtime issues.
_multiValueSettings.Add(name, [firstValue!, value]);
src/app/GitCommands/Git/Commands.Execution.cs:87
- The introduction of the append flag in SetGitSetting alters the command line arguments for git config settings. Verify that this change aligns with the intended behavior and that all callers supply the appropriate value for the new parameter.
{ isSet && append, newSyntax ? "--append" : "--add" },
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a deep review, but I think this is a good change.
How good is the test coverage?
More a point of concern to keep an eye out for is your (with caching) point. Maybe a test could be added
My concern is the cache may hold onto values that have been changed and annoy people. I love the use of git config. Maybe a watcher on the git config files to invalidate the cache may be needed. |
There are only two locations in GE which change settings:
Both invalidate all sibling caches. Though you are right. I need to invalidate the caches of GitModule yet after closing the settings dialog.
This would become complex (think of "include") up to not feasible (FileWatcher does not work for WSL). gitextensions/src/app/GitUI/GitModuleForm.cs Lines 130 to 142 in 479107f
|
Makes sense. Then maybe a force refresh config button to handle the case of config being altered outside of app. |
and declare EffectiveConfigFile read-only & private and fixup signature of IGitModule.PullCmd Refs: gitextensions#12201
because it brings insignificant speedup in its current form Refs: gitextensions#12201
and use factory method Refs: gitextensions#12201
and SetGitSetting over using LocalConfigFile Refs: gitextensions#12201
with EffectiveGitConfigSettings and remove IGitModule.GetGitSetting & GetEffectiveGitSetting Refs: gitextensions#12201
with GitConfigSettings Refs: gitextensions#12201
as replacement for IConfigFileSettings.GetValues Refs: gitextensions#12201
using extended IGitConfigSettingsGetter Refs: gitextensions#12201
with GetAllLocalSettings & SetSetting Refs: gitextensions#12201
including implementation Refs: gitextensions#12201
Just hit the |
I'm thinking more along the lines of say Visual Studio changes a config or whatnot. The app calls on git config to get needed settings often and if stale and used cache it will be out of sync. I'd imagine it would be a pain to load settings page to force invalidating cache. If cache had a clock on it that self invalidates after 10 minutes then ok. I'm just saying the cache invalidation needs to be considered. If ge loads settings at noon and knows x config. If visual studio changes at 12:05 and you do more in ge when does ge catch up to current config is my point. |
Fixes #4389
Proposed changes
IConfigFileSettings
including its implementation so that GE does not rewrite git config files any longerusing
IGitModule
:GetEffectiveSetting
GetEffectiveSetting<T>
GetSettings(string setting)
(for multi-value settings, kept existing sub-optimal name)SetSetting
UnsetSetting
IGitModule
:GetAllLocalSettings
InvalidateGitSettings
RemoveConfigSection
IGitModule
:GetSetting
(kept, but declared "deprecated", redirected toGetEffectiveSetting
)GetSetting<T>
(unused)GetGitSetting
GetEffectiveGitSetting
EffectiveConfigFile
LocalConfigFile
IGitRef
GetTrackingRemote
&GetMergeWith
(redundant to existing properties)(Review commit by commit is recommended.)
Screenshots
N/A
Test methodology
Please do not squash merge
✒️ I contribute this code under The Developer Certificate of Origin.