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

git checkout master failed #376

Open
abitrolly opened this issue Aug 30, 2021 · 6 comments
Open

git checkout master failed #376

abitrolly opened this issue Aug 30, 2021 · 6 comments

Comments

@abitrolly
Copy link

abitrolly commented Aug 30, 2021

Looks like doctr is unable to detect that the default branch for the repo is not master and fails.

Happens here https://app.travis-ci.com/github/jonmatthis/freemocap/builds/236410519 where the default branch is main.

@abitrolly
Copy link
Author

The solution is probably https://drdoctr.github.io/recipes.html#deploy-docs-from-a-non-master-branch and it would be nice if the error message was referring to that. Right now the message is a bit confusing. If docs are only pushed from master and the current branch is not master, why do the checkout?

The docs are only pushed to gh-pages from master. To allow pushing from a non-master branch, use the --no-require-master flag
This is the feature/refresh_buttons branch
ERROR: The doctr command '/home/travis/virtualenv/python3.7.1/bin/doctr deploy --built-docs docs/build/html .' failed: SystemExit('\x1b[31mgit checkout master failed: 1\x1b[0m')
git checkout master failed: 1

There might be something else going there. In addition, if doctr is supposed to fail when run from PR, it should be covered in example given in the README.

@abitrolly
Copy link
Author

Documented --branch-whitelist develop didn't help - the process took a bit further, but then again failed with git checkout master failed: 1 in the end.

https://app.travis-ci.com/github/jonmatthis/freemocap/builds/236495223

@abitrolly
Copy link
Author

I believe that's the code that is failing

doctr/doctr/travis.py

Lines 354 to 355 in 7e75711

# return to master branch and clear the working branch
run(['git', 'checkout', 'master'])

I am not sure what should happen here - the PR that fails CI proposes to merge jonmatthis:develop from abitrolly:patch-1 and doesn't touch non-existing master or default main.

@asmeurer
Copy link
Member

I thought we had code that used the API to check what the default branch was, but I guess not. Clearly we need to do that now that main is becoming more common. Actually you can probably figure it out without the API (maybe Travis has an environment variable for it, or you can just guess from the branches are present in the clone).

@abitrolly
Copy link
Author

@abitrolly
Copy link
Author

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

No branches or pull requests

2 participants