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

dura checkout command #70

Open
JakeStanger opened this issue Jan 12, 2022 · 6 comments
Open

dura checkout command #70

JakeStanger opened this issue Jan 12, 2022 · 6 comments

Comments

@JakeStanger
Copy link
Collaborator

This isn't one that should be tackled until the branch changes (#9 & related) I reckon, but a command to instantly checkout a backup would be very powerful. This could potentially be coupled with a dura restore which merges/rebases/whatever a backup to the current branch.

Immediate thoughts are the command should take fixed and relative times, and round (up/down?) to the nearest backup. This would make it easy to find/recover a last known working version.

dura checkout 1h # check out backup from an hour ago
dura checkout 2022-01-10T17:00 # check out backup from timestamp
@drupol
Copy link
Collaborator

drupol commented Jan 14, 2022

I really like the idea !

@tkellogg
Copy link
Owner

This makes sense, and I like your proposal. If I dura checkout 4h immediately followed by dura checkout 3h, I get mostly the same result as if I had done dura checkout 3h to begin with. Seems intuitive.

Is checkout the right name though? I think of it as a reset. What do you think?

@JakeStanger
Copy link
Collaborator Author

I'm thinking checkout quite literally just checks out the commit/branch (perhaps in a detached state if it's a commit, I can't remember how Git works...) and doesn't affect your main branch at all. There would be a second command that builds on it called restore or reset which actually affects the main branch.

@tkellogg
Copy link
Owner

I see. I suggest another command that resolves a commit by these same time-based rules, so you could do git log $(dura resolve 4h). Basically a dry run version of this.

@drupol
Copy link
Collaborator

drupol commented Jan 14, 2022

We could also imagine having stuff like dura diff 4h etc etc...

@tkellogg
Copy link
Owner

I'd rather wait to build lots of sugar until we get a better feel for how people will use dura. I'm in favor of the the checkout & reset commands because they consolidate a fairly long list of commands that many Git users can't do off hand.

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

3 participants