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
Block emoji from being entered as a repo name #3090
Comments
@tierninho so emoji (or non-UTF8 characters) in the repository name don't get rejected by the GitHub API? Is that accurate? What does the resulting dotcom repository home page look like? |
Correct, they don't get rejected as somewhere along the line, GitHub recognizes the special characters and converts them to
Resulting page looks like: https://github.com/tierninho/-a1 for this The controller test in GH/GH would return a 422 for dupes, but I couldn't trigger it for invalid names. |
I've noticed they are still rendering on some accounts, though. |
I was taking a look at this last night. If I understand correctly, the issue seems to be that although we sanitize names with the It may be sufficient to include this sanitization behavior we do in the I would be happy to make a pull request for this. Otherwise I would love to understand this issue a little better and what other considerations need to be made. Edit: Also, I noticed this while looking into this Issue:
It seems that GitHub.com allows repository names to have |
@tierninho Would adding the repository name sanitization that occurs in the If so, I have the changes required for this ready. I have extra details about this proposed solution in the comment above. |
@Daniel-McCarthy that seems like a sensible approach to me. I'm not sure about the reasoning for filtering out |
@outofambit Sounds great! I have the changes ready and will get a pull request ready soon.
I certainly agree. I was hoping that perhaps this might be an opportunity for some improved documentation to explain this, so I gave it a mention while it was relevant. |
I found this old thread, sorry. But I think this is relevant: the web interface for Create New Repo still allows emojis (and other "illegal" characters, presumably) and doesn't gave a hint that these will be converted to -. I actually think they should be allowed (I mean, why not?) but until that is possible & agreed upon, it's probably simpler & cleaner & more obvious & thus better to apply the same sanitiser to the (new) repo name input in the web interface. |
This is what I see when I try and specify emoji on the @ednl if you've found a different place on GitHub that isn't showing this behaviour, please share a screenshot or describe the steps to find it. |
Oh you are right, that does show. Sorry! (again). However, I think the reason I overlooked it is because the green checkmark in the textbox itself was more prominent to me. Edit: in fact, I think I did see it but dismissed it because I did not understand its implication: "will be created as -". The green check that suggests all is well confuses the message. Like: "hm the name is good, so what is this created as -?". Obviously now I know. That checkmark is deceiving; I am not sure that anyone typing certain characters on purpose which will be converted to "-", would agree that that is worth a green checkmark. The name, as typed, won't be accepted. |
Having a dot is supported in GitHub, while the `SHORT` regex is too restrictive and disallows this. Support is added for repositories that contain a period or full stop will work. There is no definitive guide to allowed characters for GitHub repositories, but you can piece together the allowed characters via moby/moby#679 and desktop/desktop#3090. Tests were also added that verified the allowed characters in the repository name.
Having a dot is supported in GitHub, while the `SHORT` regex is too restrictive and disallows this. Support is added for repositories that contain a period or full stop. There is no definitive guide to allowed characters for GitHub repositories, but you can piece together the allowed characters via moby/moby#679 and desktop/desktop#3090. Tests were also added that verified the allowed characters in the repository name.
Having a dot is supported in GitHub, while the `SHORT` regex is too restrictive and disallows this. Support is added for repositories that contain a period or full stop. There is no definitive guide to allowed characters for GitHub repositories, but you can piece together the allowed characters via moby/moby#679 and desktop/desktop#3090. Tests were also added that verified the allowed characters in the repository name.
Having a dot is supported in GitHub, while the `SHORT` regex is too restrictive and disallows this. Support is added for repositories that contain a period or full stop. There is no definitive guide to allowed characters for GitHub repositories, but you can piece together the allowed characters via moby/moby#679 and desktop/desktop#3090. Tests were also added that verified the allowed characters in the repository name.
Having a dot is supported in GitHub, while the `SHORT` regex is too restrictive and disallows this. Support is added for repositories that contain a period or full stop. There is no definitive guide to allowed characters for GitHub repositories, but you can piece together the allowed characters via moby/moby#679 and desktop/desktop#3090. Tests were also added that verified the allowed characters in the repository name.
Emoji shouldn't be allowed in place of a repo name as they are converted anyway to "normal" characters by GitHub.com and Desktop once published.
If you already have a repo with the name
github.com/tierninho/-1
and you decide to create a new repo with an emoji 🐴 as the repo name, the name becomes converted to "normal" characters as expected. However, if you click "open in GitHub" or "create PR", the existing repo is opened despite the real url beinggithub.com/tierninho/-
Just remove the Emoji option from the Edit menu?
tested 1.0.5beta0, mac
The text was updated successfully, but these errors were encountered: