Settings

Theme

Six top-level folders in a Git repo with the same name

2 points by vietjtnguyen 4 years ago · 1 comment · 1 min read


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

CodeHz 4 years ago

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

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection