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

partial diffs vs single global diff #1

Open
corollari opened this issue Jun 8, 2019 · 0 comments
Open

partial diffs vs single global diff #1

corollari opened this issue Jun 8, 2019 · 0 comments

Comments

@corollari
Copy link
Owner

Method 1:

On every new change:

  1. Store the diff between the current tree and the previous one.
  2. Replace the previous tree with the current one.

On restoring:

  1. Walk back the array of stored diffs and apply them back.

Method 2:

On every new change:

  1. Store the diff between the current tree and the one created when start was run

On restoring:

  1. Use the last diff to restore the current tree to its original state (or just replaced the current tree with the original one).
  2. Calculate which change would be the last one applied if the revert was to be carried.
  3. Apply the diff of the selected change to the current directory, so as to bring it forward in time to when the revert has dictated.

Which one is better?

I'm not totally sure which one of the is the fastest one so that should be investigated. So far, I've implemented method 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant