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

DOC: warn about --force for dirty repos #370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stsievert
Copy link

What does this PR implement?
It warns about running doctr deploy with the --force flag and dirty files.

I made the mistake of doing this, and this warning would have prevented my mistake. I am submitting this PR to ask a question: how do I recover those dirty files untracked by Git? Or are they gone forever?

@asmeurer
Copy link
Member

asmeurer commented Aug 2, 2020

doctr deploy --force should basically never be used. It forces doctr to run locally, whereas it normally only runs in Travis. It's only useful for development. We should probably hide the flag.

doctr deploy stashes your dirty changes. It should unstash them, but maybe that failed. You can try running git stash pop manually.

@stsievert
Copy link
Author

doctr deploy stashes your dirty changes. It should unstash them, but maybe that failed. You can try running git stash pop manually.

Luckily I've been able to recover. git stash didn't have my changes, but (very luckily) I've aliased rm to move files macOS's "Trash" directory.

@@ -271,7 +271,9 @@ def deploy(args, parser):

if not args.force and not on_travis():
parser.error("doctr does not appear to be running on Travis. Use "
"doctr deploy <target-dir> --force to run anyway.")
"doctr deploy <target-dir> --force to run anyway.\n\n"
"WARNING: this will remove any dirty files"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just not mentioning --force at all and also hiding it from the --help output.

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

Successfully merging this pull request may close these issues.

None yet

2 participants