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 · 2 comments

Comments

Projects
None yet
2 participants
@b6pzeusbc54tvhw5jgpyw8pwz2x6gs

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

This comment has been minimized.

Show comment
Hide comment
@eamodio

eamodio Jul 20, 2018

Owner

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.

Owner

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.

@eamodio eamodio closed this in 765dfe2 Jul 20, 2018

@b6pzeusbc54tvhw5jgpyw8pwz2x6gs

This comment has been minimized.

Show comment
Hide comment
@b6pzeusbc54tvhw5jgpyw8pwz2x6gs

b6pzeusbc54tvhw5jgpyw8pwz2x6gs Jul 21, 2018

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

b6pzeusbc54tvhw5jgpyw8pwz2x6gs commented Jul 21, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment