-
Notifications
You must be signed in to change notification settings - Fork 258
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
Assume git users can undo #1424
Conversation
Should we have some way to opt-in e.g. if you wanted a safe-mode version of usethis that would prompt about overwriting, even if you are using git? Or alternatively could we leave the defaults as-is, and just provide a way to globally opt out, e.g. an envvar or option we could put in our .Rprofile. |
No joke! I have some concern because we project an attitude of "just get started with your first package, it's easy!" and that could easily happen around the same time as "just get started with Git and do very basic stuff" (which probably doesn't include resets). So there could be people new to both Git and package development, who feel like we sent them down that path. And now we do this! If we do it, we should provide a function or other support for the relevant "git undo". |
Ok, since you both have concerns that this is too much (and I agree), I'll make this opt-in so that you also have to set some option. |
Ok, take a look now and let me know if you have any better ideas for the option name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be noted in:
https://usethis.r-lib.org/articles/articles/usethis-setup.html
probably specifically in https://usethis.r-lib.org/articles/articles/usethis-setup.html#store-default-values-for-description-fields-and-other-preferences
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I proposed some minor wording changes.
It feels like we should add a test. If you've moved on to something else @hadley, tell me and add that to finish this.
Co-authored-by: Jennifer (Jenny) Bryan <jenny.f.bryan@gmail.com>
Sure, that'd be great, thanks! |
Observation about this PR now that I'm writing tests: We have been trying to keep low-level helpers like Main principle: we don't want calls to these low-level helpers to activate or change the active project. This PR currently violates this because it does https://github.com/r-lib/usethis/blob/master/principles.md#helpers-and-the-active-project I think this PR need to be adjusted similar to those other cases, such that What should we do if the active project uses Git, but I |
Can we just base the git check on the file path vs. the active project? |
I will explore this, but yeah sounds like a good solution. |
I would be tempted to remove the git check entirely if it is complicated to do correctly, e.g. if The population of people who know enough about usethis to change the default but also aren't using git for their projects seems pretty small to me. |
It's not too hard to check if If no one has anything else to say, I'll merge this in a bit. |
Merged. I'd urge anyone who's listening to consider setting |
Fixes #1376
This is a very simple change but has big consequences. I think it's a big UI improvement for us, and at most only a minor inconvenience for others. What do you think?