-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Local history: does not preserve entries from previously deleted file #212386
Comments
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.89.1. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding! |
Still an issue in 1.89.1 |
This is likely just not implemented: a file that is moved to a name that was previously tracked will overwrite said history. Fair feature request though, as such moving to Backlog. |
Hm, something fishy is going on. We already preserve local history across renames but I can see that we seem to replace the last entry after rename, loosing the last edit that was made. Maybe we can preserve it, needs more investigation. |
Good catch, we are indeed just dropping previous entries for a file if a file is moved to that file: vscode/src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.ts Line 373 in 70e10d6
A better approach here would be to read the metadata of the entries at the location that is being moved to and merge it with the current entries. |
One consequence of this change is that the history for a file entry will be a merge of all changes applied to the previous name(s) and the current name. Since entries are all sorted by time stamp, its harder to follow over a set of changes if you go from oldest to newest entry. However, the intent of local history was always to preserve as many changes as possible and never loose any changes, so I think this new model is in the spirit of local history. |
This bug has been fixed in the latest release of VS Code Insiders! @Pyrolistical, you can help us out by commenting If things still don't seem right, please ensure you're on version 5e68ffd of Insiders (today's or later - you can use Happy Coding! |
Type: Bug
foo.txt
with some content. Save itfoo.txt
bar.txt
bar.txt
tofoo.txt
foo.txt
created in step 1.Normally when one recreates
foo.txt
you can still see history for it. But in the case where a file is renamed tofoo.txt
, the history is loss.VS Code version: Code 1.89.1
OS version: Windows_NT x64 10.0.22631
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
The text was updated successfully, but these errors were encountered: