rustlings icon indicating copy to clipboard operation
rustlings copied to clipboard

Suggestion: Support reseting an exercise

Open NicMcPhee opened this issue 3 years ago • 1 comments

It might be nice to be able to "reset" an exercise back to the initial state. This could be useful, for example, for people who want to use some of these exercises for "dojo-style" repetitive practice to, e.g., explore different ways of approaching a particular problem.

This could be handled outside of Rustlings through, e.g., your IDE or version control, but in both cases it would be messy to go back and reset an early exercise after having done twenty or thirty subsequent exercises.

I have no idea how complex this would be, but I assume it wouldn't be too bad? Presumably some git fun plus some kind of appropriate warning that you'll lose the work you have, etc., etc.

Would anyone else find this useful? Or is this just me being weird… 😜

NicMcPhee avatar Jun 19 '22 04:06 NicMcPhee

This would be interesting, I imagine the API could be something like rustlings reset errors5 or something like that. Under the hood, git stash push <filename> or something could be applied.

Seems like a handy feature

exdx avatar Jun 22 '22 02:06 exdx

I implemented the suggestion above! Please take a look at #1151 🚀

@exdx @NicMcPhee

magnusrodseth avatar Aug 17 '22 12:08 magnusrodseth

That's awesome @magnusrodseth – thanks for adding that!

NicMcPhee avatar Aug 19 '22 13:08 NicMcPhee

I wonder if it is possible to reset the whole project. Like rustlings reset all or smth...

VephoVandenberg avatar Dec 13 '23 18:12 VephoVandenberg