microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.64k stars 29.04k forks source link

The stash is not working when use the "stash + checkout" function #147351

Closed FishingGo closed 2 years ago

FishingGo commented 2 years ago

Issue Type: Bug

  1. change the any file
  2. click left-down status bar to switch to another branch
  3. vs code popup warning the changes in current current
  4. choose "Stash&Checkout"
  5. enter stash message expect result:
    expecting the change is stashed, and the branch is switched to a new one. actual result: stash is NOT saved, and also has no any warning at all. but the branch is switch to new one.

Screenshot 2022-04-13 150147

VS Code version: Code 1.66.1 (8dfae7a5cd50421d10cd99cb873990460525a898, 2022-04-06T14:50:12.141Z) OS version: Windows_NT x64 10.0.19042 Restricted Mode: No Remote OS version: Linux x64 5.14.10-300.fc35.x86_64

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8365U CPU @ 1.60GHz (8 x 1896)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.72GB (6.85GB free)| |Process Argv|--crash-reporter-id e5812083-7583-412f-852e-fb749b561a95| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|SSH: VM-1-conde| |OS|Linux x64 5.14.10-300.fc35.x86_64| |CPUs|Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz (4 x 2494)| |Memory (System)|7.75GB (0.96GB free)| |VM|0%|
Extensions (27) Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|13.2.4 systemd-unit-file|coo|1.0.6 better-cpp-syntax|jef|1.15.13 autoconf|mae|0.1.0 jupyter-keymap|ms-|1.0.0 remote-ssh|ms-|0.78.0 remote-ssh-edit|ms-|0.80.0 vscode-remote-extensionpack|ms-|0.21.0 tpl-lang|qiq|0.0.1 nunjucks|ron|0.3.1 code-settings-sync|Sha|3.4.3 vscode-openapi|42C|4.9.3 doxdocgen|csc|1.4.0 go|gol|0.32.0 better-cpp-syntax|jef|1.15.13 rpm-spec|Lau|0.3.2 python|ms-|2022.4.1 vscode-pylance|ms-|2022.4.0 jupyter|ms-|2022.3.1000901801 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.6 cmake-tools|ms-|1.10.5 cpptools|ms-|1.9.7 cpptools-extension-pack|ms-|1.1.0 vscode-yaml|red|1.6.0 helm-intellisense|Tim|0.14.2 cmake|twx|0.0.17 (2 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 pythonvspyl392:30443607 pythontb:30283811 pythonvspyt551cf:30345471 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 pythondataviewer:30285071 vscod805:30301674 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 testflightcf:30433671 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 pythonvsnew555:30457759 vscscmwlcmt:30465135 cppdebugcf:30466690 pynewfile477:30463512 ```
lszomoru commented 2 years ago

Looking at the code, choosing "Stash & Checkout" will, stash the changes, checkout the branch, and than pop the stashed changes. This means that it is expected for a stash not to be saved given that it is being popped as part of this flow. Let me know if that is not the behaviour that you are seeing. Thanks!

FishingGo commented 2 years ago

I expect the change can be stashed when follow the "stash&checkout", but actually the vscode does not stash the change , it only checkout branch.

I assume the vscode will do the stash in "stash&checkout" as it looks like, is it so?

lszomoru commented 2 years ago

@FishingGo, as mentioned above, when choosing "Stash & Checkout", VS Code will 1) stash the changes, 2) checkout the branch and 3) pop the stash. Since the stash is being popped, the stash will be removed from the stash list. You can see all the git commands that are being executed in the git output log that you can access using the "Git: Show Git Output" command from the command palette.

FishingGo commented 2 years ago

actually, this stash is NOT popped, it should be stashed into the stash list. But anyway, the issue has not been seen again since the last time. Let's close the ticket. Thank you very much for your kindly support.