-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional Source Control Functionality (#1785)
### Description We are improving upon existing source control functionality by doing the following... - Added push functionality and sheet. - Added pull functionality and sheet. - Added manual fetch functionality and fetching sheet. - Reorganized source control files in project - Renamed Features/Git to Features/SourceControl - Moved sheet views into it from the Source Control Navigator - Moved models out of Client - Moved the sync view above commit form in source control changes navigator. - Refreshing remotes cache after adding a remote. - Moved push and pull state variables into the source control manager. - Added a confirm branch switch sheet. - Stashing changes if changes exist when attempting to pull or switch branches. - Setting remote for push and pull after adding a remote. - Added warning alerts if uncommitted changes are not present - It is now possible to switch to a remote branch and create a new branch from a remote branch. - Disabling rename branch for remote branches. ### Testing Note to reviewers... Please pull down and test this in addition to reviewing the code. Once you have this pulled down... In a terminal run... ``` mkdir test.git cd test.git git init --bare ``` Then add the remote in CodeEdit by 1. going to the Source Control Navigator 2. If not already click Initiate to start a git repo 3. go to the Repositories tab 4. Right click Remotes and click Add existing remote... 5. Give the remote a name like "test" (the first remote will be "origin") and enter the path to test.git 7. You can now make changes, commit, and push via the Changes tab in the Source Control Navigator 6. You can set up additional projects by repeating steps 1-5 so you can make changes elsewhere and test pull functionality. 7. You can create additional remotes as well to test managing a project with multiple remotes, pushing and pulling from them, etc. ### Checklist - [x] Add push logic - [x] Add pull logic - [x] Add push sheet - [x] Add pull sheet - [x] Add centralized sheets view - [x] Rename Features/Git to Features/SourceControl - [x] Move sheet views into Features/SourceControl - [x] Add "Source Control" menu - [x] Add remote from push and pull sheets - [x] Set new remote in push or pull sheet after one is added - [x] Stash changes if attempting to pull or switch branches and changes exist - [x] Add fetch to the menu and display fetching sheet while fetching - [x] Add confirm branch switch sheet - [x] Add warning alerts if uncommitted changes are not present --- - [x] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md) - [x] The issues this PR addresses are related to each other - [x] My changes generate no new warnings - [x] My code builds and runs on my machine - [x] My changes are all related to the related issue above - [x] I documented my code ### Screenshots <img width="598" alt="image" src="https://github.com/CodeEditApp/CodeEdit/assets/806104/e599cb12-0772-4a6e-abca-b5f9af7fa74a"> <img width="598" alt="image" src="https://github.com/CodeEditApp/CodeEdit/assets/806104/eca3d546-d38c-4787-89ed-9930220fd4e4"> <img width="598" alt="image" src="https://github.com/CodeEditApp/CodeEdit/assets/806104/20a5c002-5fff-4920-8211-8333fce56f6b"> <img width="598" alt="image" src="https://github.com/CodeEditApp/CodeEdit/assets/806104/6e80c67b-5356-4cf7-82b7-1ad95a13e05b"> <img width="342" alt="image" src="https://github.com/CodeEditApp/CodeEdit/assets/806104/0e55f5f8-f71b-4e30-bc05-d80a5796360e"> <img width="712" alt="image" src="https://github.com/CodeEditApp/CodeEdit/assets/806104/00c61863-5cb4-409b-b2d6-40098db5c57e"> ### Todos discovered - Reload source editor contents when file is changed externally - Handle source control errors better and show necessary errors to user - Handle rebase and merge conflict flow in UI - ~~Display loading indicator when pushing or pulling~~ Be able to cancel push or pull while in progress - Display loading indicator when pulling from stash sheet - Write tests for source control features ### Commits * Getting tracked branch and changing source control navigator UI if there is not a tracked branch. * Added push and pull sheet. Renamed Features/Git to Features/SourceControl and moved sheet views into it from the Source Control Navigator. * Fixed dismiss on submit. Changed sheet width * Changed navigator tab label * Removed print statement * Fixed commit branch and tag design in history tab * `SourceControlCommands` Impl * Now that we can access source control features outside the navigator, we need to refresh git data right away rather than on navigator view init. * Added the ability to add existing remotes from the push or pull sheet and source control menu. * Added the ability to add existing remotes from the push or pull sheet and source control menu. * Added ability to fetch changes from the menu * Split up source control manager file to resolve SwiftLint error * SwiftLint fixes * Resolved PR issues * Moved the sync view above commit form in source control changes navigator. Refereshing remotes cache after adding a remote. Moved push and pull state variables into the source control manager. Stashing changes if changes exist when attempting a pull. Setting remote for push and pull after adding a remote. Renamed scm variables to sourceControlManager for clarity. * SwiftLint error fixes * Separated "Apply stash after operation" field into it's own section in stash sheet * Reset remote and branch after stash * Moved functions below body in source control views * Recfactored pull function arguments * Added more detailed comment for SourceControlManager. Moved Git models. * Made setUpstream default to false in the push function * When switching branches, we now have the user confirm. We also check for changes and if there are changes we prompt the user to stash changes before switching branches. * Added warning alerts if uncommited changes are not present * Added minimum width to buttons in source control sheets * Not showing sync view if there are no remotes. * Formatting branch and remote names in the add sheet. * Fixed push PR issue * It is now possible to switch to a remote branch and create a new branch from a remote branch. We are now disabling rename branch for remote branches. * Removed redundant nil * Added loading indicators in push and pull sheets * Fixed SwiftLint errors * Fixed SwiftLint error * Added documentation to submit functions in push and pull views * Renamed a few files that were previously moved and added documentation to new branch and rename branch views --------- Co-authored-by: Khan Winter <[email protected]>
- Loading branch information
1 parent
5eba707
commit a231637
Showing
117 changed files
with
1,516 additions
and
513 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.