Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Six top-level folders in a Git repo with the same name
2 points by vietjtnguyen on Jan 20, 2022 | hide | past | favorite | 1 comment
https://github.com/vietjtnguyen/whitespace-folder-names

https://gitlab.com/vietjtnguyen/whitespace-folder-names

I was surprised when someone pushed commits to an internal repo showing folders with the same name. Leading and trailing whitespace is allowed for a folder name and git respects this. Github and GitLab will both render the full folder name in the DOM but don't escape it with ` ` or use the `white-space: pre` [1] CSS property (TIL) which leads to whitespace collapse. Interestingly the tooltip on Github shows the full name but not on GitLab.

To me it's another example of how difficult it is to anticipate the full space of user input.

[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/white-space



BTW, the GitHub mobile app rendering them correctly (since it doesn't use html)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: