mob icon indicating copy to clipboard operation
mob copied to clipboard

Warning for 'mob reset'

Open tedyoung opened this issue 2 years ago • 6 comments

I see in issue #36 that it was decided to keep this. I've found "reset" useful, except we've had accidents where it was done unintentionally. If it's going to stay, a warning saying "this will Force Delete the branch on GitHub, are you sure you want to delete it for everyone?" would be handy.

tedyoung avatar Jul 14 '22 03:07 tedyoung

I understand and share your sentiment. However, mob.sh currently follows this design concept: 'mob is not interactive.'

Not sure how to solve that.

gregorriegler avatar Jul 14 '22 07:07 gregorriegler

Perhaps requiring an argument (that's not in the help docs)? e.g.:

mob reset --force-delete-branch

Could make the person more aware of what they're doing. So if they did:

mob reset

it would respond:

Executing this command deletes the mob branch for everyone. If you're sure you want that,
add --force-delete-branch as an argument:

mob reset --force-delete-branch

tedyoung avatar Jul 14 '22 16:07 tedyoung

I like the Idea. Would love if the argument also told that it would delete the remote branch. mob reset --delete-remote-wip-branch or something else. Also I would not mind if it was mentioned in the help.

gregorriegler avatar Jul 14 '22 21:07 gregorriegler

sounds reasonable.

simonharrer avatar Jul 15 '22 06:07 simonharrer

@tedyoung, did you want to give this a try? If not, I'll help out.

seanpoulter avatar Jul 16 '22 12:07 seanpoulter

It looks like the way to do this is to check for --delete-remote-wip-branch in the case "reset" statement in the execute function? Then a test would be similar to TestExecuteInvalidCommandKicksOffHelp looking for the output if you don't include it.

I don't have a Go environment setup at the moment, so may take me a few days to get to a PR. So if someone wants to do it before then, happy to review it.

tedyoung avatar Jul 17 '22 20:07 tedyoung

done with #305 and #313

hollesse avatar Sep 23 '22 11:09 hollesse

Yay! 👍

tedyoung avatar Sep 24 '22 01:09 tedyoung