Skip to content

Add support for local history #26339

Closed
Closed

Description

I would love to be able to see my local history for a file like you can do in intelliJ.

Activity

  1. added
    feature-request
    on May 10, 2017
  2. taseenb commented on Sep 15, 2017

    @taseenb

    That would be amazing. Jetbrains has probably the best local history support. There are a couple of extensions for VS Code but they aren't as convenient.

  3. added
    workbench-editors
    workbench-history
    and removed
    workbench-editors
    on Nov 16, 2017
  4. alkorsan commented on Oct 29, 2018

    @alkorsan

    please add this option please
    I m afried of Git, and this story make me more afreid of using it.

    THIS THING DELETED 3 MONTHS OF WORK!!!!
    #32405

    single programers we don t need all the git complexity.

  5. MarekJavurek commented on Mar 14, 2019

    @MarekJavurek

    +1 (just few mins ago, wanna discard some changes in just few files... discarded all unstaged files...)

  6. nancycg commented on Jun 13, 2019

    @nancycg

    Can anyone please suggest - "How can I see my local file history changes in VS code like we can check in eclipse IDE? Sometimes we do changes a lot in single file before commit and this feature can be really handy to check entire day's changes in one file. I have checked few plugins like "Local History" but the changed files keep on adding in my git changes section and changed file numbers keep on increasing. I doubt if I am using it correctly. Please suggest best plugin or options for it. Thanks

  7. jabacchetta commented on Jul 22, 2019

    @jabacchetta

    For reference, there is an extension, but it's not nearly as powerful as what's offered in IntelliJ/WebStorm.

    Examples of features that I'd like to see if this were to be implemented:

    • Being able to add checkpoints (local commits). This is the IntelliJ equivalent to adding tags to your history. There is another extension for that here, though.
    • Being able to support local history when the files are moved/renamed.
    • Being able to revert more than just edits (e.g. deletes, moves).

    This feature set also has synergy with #43555, #52844, and #9390.

  8. faldor20 commented on Aug 17, 2019

    @faldor20

    This is something that would be super helpful. even just to be able to save undo across sessions would be amazing.

  9. andrecasal commented on Oct 4, 2019

    @andrecasal

    Here's a horror story. I had all my files tracked in Git and began writing code for a new feature that used an API at the end of a file, so my workspace had uncommited changes. Because I had to wait for approval for more API quota to continue developing and testing my code and because my code wasn't yet commit worthy, I continued work on other projects and forgot I had uncommited changes in that repository.

    A few days later I was experimenting with some VS Code features and I needed to purposefully create some linting errors in a file to test it out, so I opened that same repository and randomly deleted a few lines at the top of the file I had been working on a few days before. I mistakenly thought I could just "discard changes" in the Source Control tab and Git would bring my file back, reinserting the lines I deleted. I closed the file, losing the ability to undo (cmd+z) the deleted lines. As I was ready to reverse the deleted lines, I hopped onto the Source Control tab and only seeing the deleted lines at the top of the file (I did not look at the Ruler on the right hand side to see I had more uncommited changes), I pressed "Discard Changes".

    A few days later my request for API quota was approved and I reopened the file. As I scrolled to the end of the file my jaw dropped and I started replaying this cute little story in my head, trying to understand out how the hell had I figured out a way to permanently delete my own work.

    TL;DR
    Local history would have saved me from having to spend a few minutes (but it could have been hours or days) rewriting permanently lost code.

    I would love an ETA on this feature and a comment on what's blocking it from being shipped.

  10. kboshold commented on Nov 12, 2019

    @kboshold

    I would love this feature! 😍

  11. 56 remaining items

  12. bpasero commented on Mar 22, 2022

    @bpasero
    Contributor

    Yeah that site is really helpful, I use it a lot. I think interval might be a bit misleading because as a user you might think that now a local history entry is created every 10s even without user action. For example setInterval in JavaScript installs a function that will run every <n>ms.

  13. andrecasal commented on Mar 22, 2022

    @andrecasal

    I vote for debounce for the sake of accuracy. Interval, frequency, and delay don't really capture what it is.

  14. bpasero commented on Mar 22, 2022

    @bpasero
    Contributor

    Another idea I had was mergeWindow. window seems to describe a time span and so merge would occur in a certain time span.

    Though window is a bit of a overloaded term, especially in an application that has a lot of window UI settings.

  15. badrelmers commented on Mar 22, 2022

    @badrelmers

    I vote for the word merge too. how about mergeChanges

  16. bpasero commented on Mar 22, 2022

    @bpasero
    Contributor

    Badr Elmers (@badrelmers) the setting itself is a number as seconds though, so I would like to have some kind of reference to time in the settings key.

  17. badrelmers commented on Mar 22, 2022

    @badrelmers

    yes. then why not mergeChangesInterval?

  18. andrecasal commented on Mar 22, 2022

    @andrecasal

    A few more suggestions:

    • saveDebounceInterval <- my current preference
    • mergeDebounceInterval
  19. jacrosby commented on Mar 31, 2022

    @jacrosby

    It seems to be impossible to go back to the old behaviour, which is to have a single timeline item called "uncommitted changes". This makes it very hard for me to see what I have changed since the last pull, without painstakingly going through each individual timeline item and memorising the full diff between each version.

    Storing local history is very useful, but could we have a switch to easily toggle between showing:

    • All individual local saves
    • All uncommited changes together (i.e. merged)

    Turning off the new local history feature in workspace settings seems to show just the git timeline without any information about uncommitted changes.

  20. bpasero commented on Mar 31, 2022

    @bpasero
    Contributor

    Uncommitted changes are accessible from the SCM changes view:

    image

    The decision to remove the entry from timeline was discussed in #145723

  21. jacrosby commented on Mar 31, 2022

    @jacrosby

    This should be something you can toggle between. And if you turn off local history then it should definitely still be shown.

  22. Chealer commented on Mar 31, 2022

    @Chealer

    Uncommitted changes are accessible from the SCM changes view:

    I did not test the proposal, but it would be useful to tag history entries in relation to SCM. If the latest committed state was flagged, that would facilitate the use case of Jimbo (@jacrosby) (as long as that entry is still in history...)

  23. bpasero commented on Mar 31, 2022

    @bpasero
    Contributor

    There is currently no relation between SCM entries and history entries, they are 2 independent providers of timeline entries.

  24. nidefawl commented on Apr 4, 2022

    @nidefawl

    I want to thank everyone involved so much for this feature.
    Last week I was able to recover 3 days of work after hitting delete on samba share directory that contained a symlink. photorec and ext4magic couldn't restore the files from my ext2 fs partition.
    I figured its all gone when I did a final grep through the vscode-insiders-server folder and found the all of the code in perfect condition. I was so happy!

  25. locked and limited conversation to collaborators on May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requeston-testplantimelinetimeline-local-history

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions