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

"apply Changes" has discarded all my changes. #451

Closed
b6pzeusbc54tvhw5jgpyw8pwz2x6gs opened this issue Jul 20, 2018 · 5 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@b6pzeusbc54tvhw5jgpyw8pwz2x6gs
Copy link

b6pzeusbc54tvhw5jgpyw8pwz2x6gs commented Jul 20, 2018

Issue Type: Bug

  • There is the file named a.txt in the master branch.
  • I edited contents of a.txt and save in VS Code.
  • in GITLENS view, master -> 1 file changed -> a.txt -> mouse right click -> select "apply changes" to move changes into staged area.
  • But nothing happened except the changes were all gone.
  • Due to "apply changes" GITLENS, I lost all my work for two hours.

VS Code version: Code 1.24.1 (24f62626b222e9a8313213fb64b10d741a326288, 2018-06-13T17:41:50.128Z)
OS version: Darwin x64 17.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz (4 x 2500)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 4, 3, 3
Memory (System) 16.00GB (0.11GB free)
Process Argv /Applications/Visual Studio Code.app/Contents/MacOS/Electron -psn_0_9341160
Screen Reader no
VM 0%
Extensions (10)
Extension Author (truncated) Version
vscode-docker Pet 0.0.27
vagrant bbe 0.5.0
vscode-instant-markdown dba 1.4.2
githistory don 0.4.2
gitlens eam 8.4.1
vsc-material-theme Equ 2.3.0
prettier-vscode esb 1.5.0
mssql ms- 1.4.0
python ms- 2018.6.0
markdown-pdf yza 1.2.0
@eamodio eamodio self-assigned this Jul 20, 2018
@eamodio eamodio added the bug Something isn't working label Jul 20, 2018
@eamodio eamodio added this to the Soon™ milestone Jul 20, 2018
@eamodio
Copy link
Member

eamodio commented Jul 20, 2018

First, I'm really very sorry that you lost your work. 😢 I will add protection ASAP that will stop that from happening again, but the root of the issue is confusion about what Apply Changes does.

Apply Changes is to be used to take the changes from a file revision and apply those changes to your working copy. It is not for saving (or staging) your working changes. So given that, Apply Changes should have taken your working changes and applied them to your working copy (basically a no-op), but unfortunately there was a bug in the code that caused it to use the changes from HEAD rather than the working copy.

I will fix that ASAP and it will be in the next GitLens release. I am also changing the order of operations for how Apply Changes works. Before I would tell git to apply the requested changes to the working copy (git checkout) and then I would have vscode open the file. Instead, I will first have vscode open the file, and then have git update it. That way vscode will add the changes to the undo buffer, so that the changes could also be easily undone if needed.

Again I'm really sorry for the time and work lost.

@b6pzeusbc54tvhw5jgpyw8pwz2x6gs
Copy link
Author

Thank you for your quick response. I am always thankful for contributing the best git extension!!

@doutdex
Copy link

doutdex commented Oct 24, 2018

Hey, I got the same issue 3 days of full work on a file is lost, exist a wat revert or check history within Visual Studio to get back my last data of the file.....

@eamodio
Copy link
Member

eamodio commented Oct 24, 2018

Sorry that you lost work, but what were the steps that caused it? This bug has been fixed so I'd like to understand if there are other issues lurking.

@eamodio eamodio removed this from the Soon™ milestone Jul 19, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants