-
Notifications
You must be signed in to change notification settings - Fork 29
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
Reduce steps needed to reset workspace #860
Conversation
const response = await getWarningResponse( | ||
'Are you sure you want to discard ALL workspace changes?\n' + | ||
'This is IRREVERSIBLE!\n' + | ||
'Your current working set will be FOREVER LOST if you proceed.', |
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.
[F] This pretty much matches what the git extension throws up. You can see a comparison in the first demo.
expect(mockGitReset).to.be.calledWith({ | ||
args: ['clean', '-f', '-d', '-q'], | ||
cwd: dvcDemoPath, | ||
executable: 'git' |
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.
[F] Definitely do not want to be calling these actions in tests
executable: 'git' | ||
}) | ||
await executeProcess({ | ||
args: ['clean', '-f', '-d', '-q'], |
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.
[F] We need this to remove untracked from the workspace.
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.
this mirrors what the git extension does
"when": "scmProvider == dvc && dvc.commands.available == true" | ||
}, | ||
{ | ||
"command": "dvc.checkout", |
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.
[F] This now goes into a new context menu which we can build on.
I'll admit on first read I found it a little scary how nuclear this is, but it seems like a totally viable workflow that users will appreciate, and considering the Git extension does something similar we should be in the clear. |
… update-checkout-action
Code Climate has analyzed commit d60e25a and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (85% is the threshold). This pull request will bring the total coverage in the repository to 96.5% (0.0% change). View more on Code Climate. |
This PR introduces a
Reset the Workspace
command in place of what wasCheckout
at the root of each SCM view. This command goes further than the previous one by first runninggit reset --hard HEAD
&git clean -f -d -q
to remove all of the current git changes in the workspace, it then runsdvc checkout
to clear out any remaining difference betweenHEAD
and what is in the workspace. The user will not have to understand / hold this concept in their head, they just go back to a clean workspace. LMK what you think on this one.Demo:
Screen.Recording.2021-09-30.at.12.43.33.pm.mov
Screen.Recording.2021-09-30.at.1.10.55.pm.mov
Note: I have a strong feeling that we should make this command available from the command palette which means I will have to introduce a
Repositories
class which will look a lot like theExperiments
one.Relates to #609