atom-local-history icon indicating copy to clipboard operation
atom-local-history copied to clipboard

Diff and easy restore for files

Open samdesota opened this issue 9 years ago • 9 comments

There should be a command to easily restore a file. The current file will of coarse be added to the history.

I'll probably build this when I have a moment.

samdesota avatar Jul 12 '15 16:07 samdesota

Hello,

Generally, I do, either copy / paste the entire file or I merge incrementally with Meld (from the command Local history diff tool).

A great feature would be to make a diff and restores directly from Atom!

Nicolab avatar Jul 13 '15 07:07 Nicolab

We could fork https://github.com/floydpink/atom-compare-files and add the merge functionality.

samdesota avatar Jul 14 '15 01:07 samdesota

I think the best is to use a generic NPM module like JSdiff

However, this require time to integrate. I'm busy at the moment :/ If you want make this feature, I merge with pleasure. If nobody does, may be I will do it but in a long time.

Nicolab avatar Jul 14 '15 07:07 Nicolab

@Nicolab I'm interested why to not make git repo for all your folders, and make autocommits. git isn't dependency - it's should be installed to install atom (or on Windows it's untrue?) If this is not a solution I have a time to make this with JSdiff. I think to use two panes diff, like in https://github.com/mupchrch/split-diff

slavaGanzin avatar Sep 22 '15 21:09 slavaGanzin

Maybe it would be interesting to choose with difftoolcommand.

So, a custom command that launches the diff view in Atom (same way as Meld).

Concerning the autocommit, I don't know if it's necessary. Maybe be yes but this strategy requires lots of code change.

Nicolab avatar Sep 23 '15 09:09 Nicolab

Using external diff tool isn't ok because it can not be updated instantly. I think it's boring to open history files one-by-one. What I really want - http://sjl.bitbucket.org/gundo.vim/ or https://github.com/mbbill/undotree functionality. I don't think we need tree definitely, but without that history branches wouldn't comfortable.

And why local history isn't incorporated into text-buffer directly it's very frustrating to loose history when you restart atom. In vim constant history is in core. Do you investigate this before starting your plugin?

slavaGanzin avatar Sep 23 '15 12:09 slavaGanzin

@terraqout This.

Perserving undo when files are reopened, trees, time based undo. All things I have yet to get used to not having.

This should probably be a separate repo though.

samdesota avatar Sep 23 '15 14:09 samdesota

terraqout: Do you investigate this before starting your plugin?

No, because it's not the goal. The goal is only to save the file revision (not the buffer revision).

mrapogee: This should probably be a separate repo though.

:+1:

Nicolab avatar Sep 24 '15 12:09 Nicolab

Just to follow the track:

  • Diff tool setting, support of internal command added by PR #38
  • @NerdPad posted an awesome timeline view example, git-time-machine (show diff inside Atom itself)

Nicolab avatar May 22 '16 16:05 Nicolab