Skip to content
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/SCM - Unstage resets all files! #11633

Closed
jaredkipe opened this issue Sep 2, 2022 · 4 comments · Fixed by #11635
Closed

Git/SCM - Unstage resets all files! #11633

jaredkipe opened this issue Sep 2, 2022 · 4 comments · Fixed by #11635
Assignees
Labels
critical critical bugs / problems git issues related to git scm issues related to the source control manager

Comments

@jaredkipe
Copy link

Bug Description:

Unsure if this is a problem with git or scm, but if you are working and stage some files. If you use the GUI to stage and then unstage (the minus button that says "Unstange Changes"), it will in fact reset all modified files.

Not just the one file. Poof, all your work gone.

Also, 'unstage all' does the same thing.

Steps to Reproduce:

  1. make changes in a git repo
  2. stage a file
  3. unstage file

All modified files are reset. If the file you unstage is new, it will also be gone.

Additional Information

  • Operating System: Linux ee15-1--web-584c4b74bb-9qfft 5.10.0-14-cloud-amd64 Initial Project Setup #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux
  • Theia Version: 1.29.0
@jaredkipe
Copy link
Author

First glance at changes makes this feel like the most likely commit to me. 422063b

Is this ambiguous? scmProvider == git && scmResourceGroup == workingTree || scmProvider == git && scmResourceGroup == untrackedChanges
Can they all become scmProvider == git && (scmResourceGroup == workingTree || scmResourceGroup == untrackedChanges)

Code for STAGE And DISCARD (_ALL), but is DISCARD the same as "unstage"?

@colin-grant-work colin-grant-work self-assigned this Sep 2, 2022
@vince-fugnitto vince-fugnitto added git issues related to git scm issues related to the source control manager critical critical bugs / problems labels Sep 2, 2022
@colin-grant-work
Copy link
Contributor

colin-grant-work commented Sep 2, 2022

It looks like we are invoking the commands correctly on the frontend - the long when clauses are unfortunate, but context keys don't support (), so they're necessary - but things go wrong on the backend after #11445 (@msujew). Looks like we may need to modify the flags we pass on the backend: @vince-fugnitto suggests adding { reset: 'index' } - I'll open a PR.

@jaredkipe
Copy link
Author

Excellent debugging! Looks like that is the problem.

I don't know how this project merges and builds, will this land in 'latest' (1.29.x) or 'next' (1.30.x)? And maybe when? I guess I'm just trying to see if I should work on a patch or just wait a day and rebuild.

@vince-fugnitto
Copy link
Member

I don't know how this project merges and builds, will this land in 'latest' (1.29.x) or 'next' (1.30.x)? And maybe when? I guess I'm just trying to see if I should work on a patch or just wait a day and rebuild.

@jaredkipe generally the project performs latest releases at the end of each month (1.29.0 to 1.30.0) unless a patch release is performed (ex: 1.29.1). The next releases are performed on each merge to master so you can potentially use the next when ready if you'd like.

A workaround for the bug for your own product can also include pinning the dugite-extra dependency using yarn resolutions (in your application's package.json) as there was no bug with that version:

"resolutions": {
  "**/dugite-extra": "0.1.15"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical critical bugs / problems git issues related to git scm issues related to the source control manager
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants