-
Notifications
You must be signed in to change notification settings - Fork 66
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
Improve "how to recover" experience #4
Comments
Using a recent-enough git version, you can use https://git-scm.com/docs/git-restore, and combine this with some
Note that by default it will restore all the files in your repository, even if you are in a subdirectory (that's the magic part done by |
As it turns out, you don't even need
The alias will fail if you don't provide a date, which is working as intended (but the error message is confusing, let me know if you want error handling for it). |
And if you want to list from all dura branches, and not only the one deriving from HEAD, it's even easier:
|
Can you send a pull request to add this to the README? If you're feeling brave, you could even add this to fn set_git_alias() -> Result<(), Error> {
let git_alias = "...";
let cfg = Config::open(Config::find_global()?)?;
cfg.set_str("alias.dura-reset", git_alias)?;
Ok(())
} |
The readme outlines how to use a
dura
branch to recover, but it involves a lot of git-fu. It could be a lot easierIdea: sub-commands
Add
dura
subcommands to do things likedura head
dura head 4h
. I imagine this searching acrossdura
branches, since we can indeed go prior to the HEAD commit.Idea: Add help messages in relevant places
Documentation in the readme is great, but it could be better if we added help directly into messages that
dura
has to leave anyway. For example, why not set the commit message to something like:The text was updated successfully, but these errors were encountered: