drdoctr / doctr

A tool for automatically deploying docs from Travis CI to GitHub pages.
https://drdoctr.github.io
MIT License
107 stars 30 forks source link

git user.email failing to auto-detect #138

Closed danielballan closed 7 years ago

danielballan commented 7 years ago

Has anyone else seen this error?

*** Please tell me who you are.
Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'travis@testing-docker-d1d30905-1f6c-4664-aa3b-7945fba5627e.(none)')

excerpted from https://travis-ci.org/danielballan/photomosaic/builds/175131428#L803

Doctr was previously working seamlessly, and I'm not sure what has changed. I can see from the log that doctr manually sets the git user.name but not the user.email. Maybe it should.

asmeurer commented 7 years ago

This was intentional. There's no email for doctr to set, so I just left it as the default, which is derived from the machine name.

danielballan commented 7 years ago

That makes sense. It looks like the default was previous acceptable to git, but now it is not.

asmeurer commented 7 years ago

So did doctr actually fail in that build?

danielballan commented 7 years ago

The build passed but the new doctr step did not complete successfully; the new docs were not uploaded. This is how it ended:

*** Please tell me who you are.
Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'travis@testing-docker-d1d30905-1f6c-4664-aa3b-7945fba5627e.(none)')
error: Your local changes to the following files would be overwritten by checkout:
    docs/.doctr-files
    docs/_modules/index.html
    docs/_modules/photomosaic/photomosaic.html
    docs/_sources/index.txt
    docs/genindex.html
    docs/index.html
    docs/objects.inv
    docs/palette-1.pdf
    docs/palette-2.pdf
    docs/palette-3.pdf
    docs/palette.html
    docs/reference.html
    docs/search.html
    docs/searchindex.js
    docs/tutorial-1.pdf
    docs/tutorial.html
Please, commit your changes or stash them before you can switch branches.
Aborting
Done. Your build exited with 0.
danielballan commented 7 years ago

As you'd expected, manually setting the user.email before running doctr deploy fixes the problem. My guess is that git has become smart enough to know that Travis's default email address, which ends in .(none), is not a valid email address.

asmeurer commented 7 years ago

Ah, so git isn't committing, leading to the other errors. So there are two issues here:

asmeurer commented 7 years ago

My guess is that Travis updated git recently. I searched the recent git release notes and found this, which seems relevant.

asmeurer commented 7 years ago

OK, I can reproduce the issue, but for me, the build fails.

asmeurer commented 7 years ago

Ah, it's because you have doctr deploy in after_success, which does not affect the build result. We should update the docs about this.

asmeurer commented 7 years ago

I guess we can use drdoctr@users.noreply.github.com https://help.github.com/articles/keeping-your-email-address-private/#step-2-tell-git-to-use-your-private-email-address. Can't think of a better dummy email.

danielballan commented 7 years ago

That all looks right to me. Thanks for the thorough follow-up.