Allow checking out this repository on Windows#2025
Merged
dscho merged 2 commits intogit:gh-pagesfrom Jul 25, 2025
Merged
Conversation
On Windows, colons are not allowed in filenames, and neither are
question marks. Let's just rename the files whose filenames contain
colons or question marks (simply removing them, there are no
collisions).
The affected files (all in the ProGit book) already contain `url`
attributes in the front matter, meaning: Hugo will use the correct
filename in the rendered output, and therefore the end result is the
same as before.
This trick was performed by
git -c core.quotePath=false ls-files |
grep ':' |
while read path
do
git mv --sparse "$path" "${path/:/}" ||
break
done
and
git -c core.quotePath=false ls-files |
grep '?' |
while read path
do
git mv --sparse "$path" "${path/\?/}" ||
break
done
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We just fixed the checkout on Windows by renaming files whose names contain colons or question marks. Let's prevent those filenames (which are invalid on Windows) from being re-generated in the future. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This comment was marked as off-topic.
This comment was marked as off-topic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Context
Kinda reported here: On Windows, filenames cannot contain certain characters such as colons, question marks, etc. But there are some six hundred plus files in this repository that do contain these characters in their file names.
Luckily, Hugo allows for files to have filenames that do not correspond to their final URL: Simply specify the
urlattribute in the front matter and use whatever filename your heart desires.Even more luckily, the automation already adds said
urlattribute in case the URL contains these special characters.All I had to do was to rename the files, and then update the script that updates the files in
external/book/whenever the upstream ProGit source truth changes.Note: Due to the filename restrictions that still apply, even to the output of Hugo in
public/, it is still impossible to process the book via Hugo; It will fail thusly:This is outside of our control; If you need to build the site locally on Windows and cannot limit it via a sparse checkout to exclude the affected files, you only have the option of using the Windows Subsystem for Linux, otherwise you're out of luck.