-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Git Improvements #1458
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 Improvements #1458
Conversation
@avinizhanov : Some considerations:
Check it out here: #593 (comment)
2b) Specific case: Solution shell, specific caseTo clone specific branches from a Git repository using the `git` command, you can follow these steps:
This command clones only the
This command clones only the
|
Ok, I'll add it.
Yes. It will update git status for a file. Here is example: Screen.Recording.2023-10-23.at.7.17.27.AM.mov
Yes, copied label from VS Code (Sync Changes/Publish Branch). I can rename it.
I just checked VS Code, PhpStorm and Xcode. Only xcode asking branch before cloning. |
Do you mean if you commit file in VS, will it update status in CE?
For now it will only push. Pull is not supported yet.
I'll try to do this. |
@avinizhanov : That's what I meant: Registrazione.schermo.2023-10-23.alle.16.42.58.mov |
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.
Great work! I was only able to quickly skim through the code, but it looks pretty good overall. Just a few small improvements to consider: better error handling, more informative comments, and clearer function names.
...vigatorArea/SourceControlNavigator/Views/Repositories/SourceControlNavigatorBranchView.swift
Outdated
Show resolved
Hide resolved
...atorArea/SourceControlNavigator/Views/Repositories/SourceControlNavigatorNewBranchView.swift
Show resolved
Hide resolved
...atorArea/SourceControlNavigator/Views/Repositories/SourceControlNavigatorNewBranchView.swift
Outdated
Show resolved
Hide resolved
@avinizhanov : Some considerations:
![]()
![]()
|
@Angelk90 To address your 3rd point, when the user switches to a remote branch, it'll be up to them to pull changes. This is the same as gh desktop. I've addressed your 2nd point in a review I'm finishing up now. Lets leave ssh cloning to a different PR. We'll need to add support for keys and other authentication methods to fully support that. |
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.
I've left a bunch of suggestions, they're all small changes to either code style or a small UI change and a few bug fixes. This is a large PR and I think it's needed to have a good base for our git integration, so I think we'll hold off on any further UI changes in this PR. I have more UI things I want changed but I think we'll merge them in a different PR due to this PR already being large. For now the UI works and can be improved on.
CodeEdit/Features/Git/Clone/ViewModels/GitCheckoutBranchViewModel.swift
Outdated
Show resolved
Hide resolved
CodeEdit/Features/InspectorArea/HistoryInspector/HistoryInspectorView.swift
Show resolved
Hide resolved
...gatorArea/SourceControlNavigator/Views/Changes/SourceControlNavigatorChangesCommitView.swift
Show resolved
Hide resolved
...vigatorArea/SourceControlNavigator/Views/Changes/SourceControlNavigatorChangedFileView.swift
Show resolved
Hide resolved
...vigatorArea/SourceControlNavigator/Views/Changes/SourceControlNavigatorChangedFileView.swift
Show resolved
Hide resolved
@thecoolwinter thanks for suggestions. I fixed most of them and added comments for 2. |
@thecoolwinter , @activcoding : For point 2) if there is only one branch there is no need for the checkout request. @thecoolwinter: For point 3) I didn't understand from your message whether it will be implemented or not. |
Yes you're right, maybe I misunderstood the original problem. @avinizhanov There should be a check in WelcomeView#L119 to make sure there's more than one branch before showing the sheet.
Yes, it will be implemented. I'd like to make sure it supports cases where a passkey is needed to access an SSH key from keychain. For now though in my testing using SSH to clone a repo did work. If you clone using SSH via terminal do you get any prompts or errors? |
The reason I think is that you only have one ssh key. When I clone from the terminal I have to do: But every time I have to fix url. .ssh/config:
|
@Angelk90 @thecoolwinter Fixed this one. |
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.
One last change and then I think this is good to go.
@thecoolwinter works good. thanks |
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.
Great work @avinizhanov!
Description
I did a few git improvements:
GitClient
changed all operations to async and changed all calls wrapped inTask
, some operations was blocking main thread. Also changedGitClient.runLive
from publisher to async stream, for some reason publisher failed for me in the middle of large cloning and I didn't find a reason why. Async stream works fine.SourceControlManager
/GitClient
is now single object per workspace. Except for clone.Screencasts with changes:
Git cloning progress and cancelation (for large git repos). When you cancel cloning it will remove folder previously created for this repo.
Parsing of cloning output and progress calculation inspired by https://github.com/microsoft/vscode/blob/main/extensions/git/src/git.ts
Screen.Recording.2023-10-21.at.2.07.54.PM.mov
Cloning and branch selection (if more than one branch)
Screen.Recording.2023-10-21.at.2.12.29.PM.mov
Git status in project navigator/source control navigator and discarding changes.
If file opened in a tab, it will not reload content. I think this requires changes to
CodeEditTextView
.Screen.Recording.2023-10-21.at.2.16.29.PM.mov
Commit and push.
Screen.Recording.2023-10-21.at.2.21.42.PM.mov
Branches view, new branch, delete branch, checkout (local and remote).
Screen.Recording.2023-10-21.at.2.24.06.PM.mov
Design used inspired by VS Code, Intellij and Xcode.
If you have any suggestions I can change it.
Related Issues
Checklist
Not sure about warning, it doesn't generate any new in Xcode for me 🙂