Giter Club home page Giter Club logo

local-history's Introduction

Local History

An extension for VS Code for maintaining versions of your files easily without saving all the files content.

Every time a file is saved, Local History will compare the old version to the new version and save the differences. All differences are saved inside the folder in the configuration (default: .lh).

The Local History folder is structured like the root folder for easy navigation.

Ignored files are stored in .lh/.lhignore as Regular Expressions.

Local History uses jsdiff by Kevin Decker

Features

  • Saving differences between files without copying the whole content.
  • Comparing versions side by side with highlighting the changes.
  • Graphical User Interface for managing, editing and restoring old versions.
  • Adding commits to organize your changes.

Overview

Every time a file is saved, a diff is saved inside the difference folder which can be configured from the extension settings. You can maintain your versions in the Local History bar.

Overview

Create Commit

Create commit if you're happy with the current code. Don't worry, older commits are also saved if you want to go back or compare.

Create Commit

Extension Settings

"local-history.enable": Determine if the extension will be active and track file changes. Can be changed in all scopes (User, Workspace  and Folder).
"local-history.localHistoryPath": Local history directory name, relative to the workspace root.
"local-history.browser.descending": Change the diffs order in the Diff View. 
"local-history.commits.clearPatchesOnNewCommit": If true, all old patched will be deleted when new commit is being created. This configuration helps save some disk space. 
"local-history.commits.patchDelay": The time to wait between saving new diffs. Each file have his own time stamp.
"local-history.date.dateFormat": The format for date representation (see below). 
"local-history.date.dateRepresentation": After the time passed the browser will show the date (formatted as date.dateFormat) instead of how much time passed (e.g. 5 minutes ago).

Known Issues

  • Some features does not work as expected when using SSH.
  • Notebooks differences are not being saved - see #9.

Release Notes

1.6.0

  • Added config for the differences folder.

1.5.0

  • Added global ignored files.

1.4.0

  • Local History dir is now hidden.

1.3.0

  • Added support for symbolic links.

1.0.6

  • Added command to open the diff for the active file.

1.0.4

  • Added Commit All command.
  • Fixed some single root workspace issue.

1.0.2

  • Changed default extension enablement to false.
  • Added enable prompt.
  • Added icon :)

1.0.0

  • Initial release of Local History.

Full changelog can be found here

local-history's People

Contributors

elazarcoh avatar neriyaco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

randallflagg

local-history's Issues

First edit of a file does not get recorded

I am using "files.autoSave": "onFocusChange", and after installing the extension, any file being edited the first time does not have its difference recorded.

FYI, your extension works in devcontainers! The timeline VSCode feature saves changes inside the devcontainer, which is lost when the container is rebuilt. Meaning the 15 million dev container extension users should also use yours!

Issue when file path contains a link

I started using this extension yesterday, so far it seems great, thanks.

I have one issue where if I edit files in a sub-directory which is in fact a link then the changes aren't saved in local history. Also, the local history file explorer doesn't appear to show links at all.

Diffs are not shown in vscode

Diffs are created in the .lh folder, but the ui doesn't show anything.
My vscode:

Version: 1.56.1
Commit: e713fe9b05fc24facbec8f34fb1017133858842b
Date: 2021-05-06T10:08:16.954Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Linux x64 5.8.0-53-generic snap

Auto select current file

Hi, I love your extension. It is very helpful.
I wish the extension would automatically switch to the history of the current file.

Not working?

Hi,
I'm trying to use the extension.

I see the diff created in the .lh folder:

image

But when I try to check them in the dedicated tab, nothing appear:

image

Nothing is showing in VSC local history

Hi.

I install last version of this extension from official market place. Everything looks alright,but nothing is showing in history.In lh folder are files which I changed.

Faster way to get to diffs for current file.

Nice extension, thanks. Currently it's ergonomically a bit awkward to see changes for the current file: open the local history view & click possibly several levels down the file tree. It would be very handy to have a command to focus on the diffs view for the file in the currently active editor.

I also suggest that when the diffs view is focussed, keyboard focus stays there while the user hits arrow keys to see the next/previous diffs, with a keyboard shortcut to jump back to the active editor once the required diff has been surfaced.

.lhignore wrong EOL

Hi,

The .lhignore file is created with LF mode on Windows.
However, the EOL used to split the lines is CRLF. So the settings do not work as expected.

If the extension uses the newline of the OS, the file should be created with the corresponding EOL or be compatible with both.

Thanks

[feature request] ignored files for all the workspace

Current ignored files stored in .lh/.lhignore are workspace-specific.
Is it possible to have a universal config to ignore some files for all the workspace?
For example, I'd like to avoid history files of *.csv for all my projects without modifying the separate config files.
Thanks.

request global ignored files

Thanks for the great extension. It's really helpful.
Is it possible to set the global ignored files in the config?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.