I have a binder repo here. When people click on the "Launch binder" button, they see this:

Which is really not ideal because then they think that something went wrong and that there is some bug, when in fact everything is fine.
I think the reason it looks that way is that I'm actually not linking to a specific notebook, but instead just to the whole repo. I think in that case it would be better to not show a 404 link during build, but something that looks less scary and that doesn't look like something went wrong.
EDIT: This was originally posted over in the repo2docker repo as https://github.com/jupyter/repo2docker/issues/761, but @betatim asked me to move it here. He also pointed out a workaround over there, which I have since implemented in my repo. So the link in this issue here now points to an old version of the repo that has the old type of link. While the workaround is great, I think it would be great if things worked without it.
My initial response on the repo2docker issue tracker:
Thanks for reporting this. Could we close the issue here and move it to https://github.com/jupyterhub/binderhub? Unfortunately I can't move it across organisations on GitHub :(
There should already be an issue in the BinderHub repository discussing if we can detect if the nbpreview would show something useful or not and only if it would show it, otherwise hide it.
To reproduce the issue use https://mybinder.org/v2/gh/davidanthoff/teaching-2019-aere-workshop.git/v1.0.1 (with a tag). If you use https://mybinder.org/v2/gh/davidanthoff/teaching-2019-aere-workshop.git/master you see a directory listing which is "the right thing" to do. Maybe it is our URL parsing that is broken which means we don't get a directory listing for links with a tag in them?
Also just noticed that https://mybinder.org/v2/gh/davidanthoff/teaching-2019-aere-workshop/v1.0.1 works which would suggest it is the extra .git that breaks the preview, not the tags.
There are two things to do here:
.git in their URLs for GitHub repositoriesThere is a kinda third thing: investigate removing the .git when we generate the URL
Also came up in https://github.com/scikit-learn/scikit-learn/pull/11221
find the issue that discusses not showing the preview if it would show a 404 or similar
I believe this is https://github.com/jupyterhub/binderhub/issues/816
I added a https://github.com/jupyterhub/binderhub/issues/816#issuecomment-522830758 there and removed my similar comment here since #816 seems a more appropriate issue.
Most helpful comment
There are two things to do here:
.gitin their URLs for GitHub repositoriesThere is a kinda third thing: investigate removing the
.gitwhen we generate the URL