git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Illegal filename characters one Windows

From
Clemens Buchacher <drizzd@aon.at>
Date
Apr 15, 2012, 00:07 UTC
Message-ID
<20120415000725.GA32140@ecki>
Hi,

I recently noticed that git does not deal very well with illegal filenames on Windows. I have a repository which contains a couple of filenames like "Re: some email.eml". On a Windows box, those files get truncated to just "Re" during checkout, because ':' is an illegal character for filenames on Windows. [1]

I know that the easiest solution would be to simply remove the illegal characters on my Linux box and be done with it. But I dislike the fact that git cannot handle such filenames more gracefully.

So I have been wondering how to fix this. I have considered converting the filename to unicode or URL encoding or even just dropping the illegal characters on checkout. But no matter which conversion I choose, it will conflict with the converted filename, which would be a valid index entry itself.

If a reasonable solution is not possible, maybe we should not try to checkout such files at all, and mark them with --skip-worktree. That way one can at least use such repositories, as long as one does not have to touch any files with illegal characters in their filename. As it is, most commands are not usable because the work tree is always dirty (the files with illegal names have been "removed").

Any better ideas?
Clemens
[1] http://en.wikipedia.org/wiki/Filename
Next: Johannes Sixt
Message 1 of 2 in “Illegal filename characters one Windows”
  1. Clemens BuchacherApr 15, 2012
  2. Johannes SixtApr 15, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.