-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Source Control Settings #1926
base: main
Are you sure you want to change the base?
Source Control Settings #1926
Conversation
…we disable file events on the .git folder. Enabling git settings by default.
…n Settings by clearing the current branch stored in the source control manager.
…isabled automatic fetching is disabled.
…e the users global git config instead of CodeEdit settings. Introduced Limiter.debounce and Limiter.throttle.
…abled, if disabled no merge commits are displayed.
CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGitView.swift
Show resolved
Hide resolved
CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGitView.swift
Outdated
Show resolved
Hide resolved
CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGitView.swift
Show resolved
Hide resolved
CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGeneralView.swift
Outdated
Show resolved
Hide resolved
…h excluded files list and ignored files list to use new shared glob list view.
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.
Some improvements are needed before merging.
CodeEdit/Features/Settings/Pages/SourceControlSettings/Models/IgnorePatternModel.swift
Outdated
Show resolved
Hide resolved
CodeEdit/Features/Settings/Pages/SourceControlSettings/Models/SourceControlSettings.swift
Outdated
Show resolved
Hide resolved
CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGeneralView.swift
Outdated
Show resolved
Hide resolved
CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGitView.swift
Outdated
Show resolved
Hide resolved
…mentation and TODO.
…e in the users .gitignore_global file. Users can now reorder ignored files. Buttons were added in settings to open .gitconfig and .gitignore_global in an editor.
ignoreGlobPatterns.append(GlobPattern(value: "")) | ||
} | ||
|
||
func removePatterns(_ selection: Set<UUID>? = nil) { |
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.
Because we are using a set here, we can take advantage of its constant look up times:
if let selection, !selection.isEmpty {
let patternsToRemove = Set(selection.compactMap { getPattern(for: $0) })
ignoreGlobPatterns.subtract(patternsToRemove)
}
self.selection.removeAll()
@@ -130,6 +133,15 @@ struct WorkspaceView: View { | |||
: themeModel.selectedLightTheme | |||
} | |||
} | |||
.onChange(of: sourceControlIsEnabled) { newValue in | |||
if !newValue { |
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.
Im still confused by this, can someone take a look at this too? The branches seem to be inverted. When source control gets enabled, we will set the branch to nil. When it gets disabled, we refresh the current branch.
FileManager.default.createFile(atPath: fileURL.path, contents: nil) | ||
} | ||
|
||
NSDocumentController.shared.openDocument( |
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.
Will this need an await
like in line 224 in the openGitIgnoreFile
function?
Description
Our source control settings currently do not work. This PR enables many of these settings. Some of these settings use the users git config so we are introducing functionality to get and set based on config keys. As the user types, we want to debounce the set function, so we are also introducing
Limiter
which hasdebounce
andthrottle
methods.Related Issues
Checklist
Screenshots
Screen.Recording.2024-10-28.at.10.30.31.PM.mov
Screen.Recording.2024-10-28.at.10.50.04.PM.mov
Screen.Recording.2024-10-28.at.10.58.13.PM.mov