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

Local history: does not preserve entries from previously deleted file #212386

Closed
Pyrolistical opened this issue May 9, 2024 · 7 comments
Closed
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member insiders-released Patch has been released in VS Code Insiders timeline-local-history verified Verification succeeded
Milestone

Comments

@Pyrolistical
Copy link

Pyrolistical commented May 9, 2024

Type: Bug

  1. Create file foo.txt with some content. Save it
  2. Delete foo.txt
  3. Create bar.txt
  4. Rename bar.txt to foo.txt
  5. Look at TIMELINE
  6. See no history for 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 to foo.txt, the history is loss.

VS Code version: Code 1.89.1
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 5800X3D 8-Core Processor (16 x 3400)
GPU Status 2d_canvas: enabled
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
Load (avg) undefined
Memory (System) 31.92GB (16.35GB free)
Process Argv --crash-reporter-id cca6ff05-6383-4d91-895f-0091516fe9b0
Screen Reader no
VM 0%
Extensions: none
@VSCodeTriageBot
Copy link
Collaborator

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!

@Pyrolistical
Copy link
Author

Still an issue in 1.89.1

@bpasero bpasero added the feature-request Request for new features or functionality label May 10, 2024
@bpasero bpasero changed the title File timeline history is permanately loss when a file is renamed to delete file Track local file history across deletions and renames May 10, 2024
@bpasero bpasero changed the title Track local file history across deletions and renames Track local file history across deletions May 10, 2024
@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone May 10, 2024
@bpasero bpasero changed the title Track local file history across deletions Track local file history across renames May 10, 2024
@bpasero bpasero changed the title Track local file history across renames Track local file history across renames to previously existing file May 10, 2024
@bpasero bpasero modified the milestones: Backlog Candidates, Backlog May 10, 2024
@microsoft microsoft deleted a comment from VSCodeTriageBot May 10, 2024
@bpasero
Copy link
Member

bpasero commented May 10, 2024

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.

@bpasero bpasero self-assigned this May 10, 2024
@bpasero bpasero added info-needed Issue requires more information from poster and removed feature-request Request for new features or functionality timeline-local-history labels May 10, 2024
@bpasero bpasero removed this from the Backlog milestone May 10, 2024
@bpasero bpasero added confirmation-pending and removed info-needed Issue requires more information from poster labels May 10, 2024
@bpasero
Copy link
Member

bpasero commented May 10, 2024

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.

@bpasero bpasero changed the title Track local file history across renames to previously existing file File timeline history is permanately loss when a file is renamed to delete file May 10, 2024
@bpasero bpasero added timeline-local-history bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member and removed confirmation-pending labels May 10, 2024
@bpasero bpasero added this to the May 2024 milestone May 10, 2024
@bpasero bpasero changed the title File timeline history is permanately loss when a file is renamed to delete file Local history: does not preserve entries from previously deleted file May 10, 2024
@bpasero
Copy link
Member

bpasero commented May 10, 2024

Good catch, we are indeed just dropping previous entries for a file if a file is moved to that file:

await this.fileService.move(sourceHistoryEntriesFolder, targetHistoryFolder, true);

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.

@bpasero
Copy link
Member

bpasero commented May 13, 2024

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.

@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label May 13, 2024
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels May 13, 2024
@bpasero bpasero added the author-verification-requested Issues potentially verifiable by issue author label May 15, 2024
@VSCodeTriageBot
Copy link
Collaborator

This bug has been fixed in the latest release of VS Code Insiders!

@Pyrolistical, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 5e68ffd of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@sandy081 sandy081 added the verified Verification succeeded label May 28, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member insiders-released Patch has been released in VS Code Insiders timeline-local-history verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants