I have a repository that has windows (cp1252) and linux (utf8) committers. Obviously Git gets confused, and puts invalid (from linux's perspective) filenames. I know I can use hooks to rename the files in one side (on linux's side, for instance, renaming the files from cp1252 to utf8 when they come and the reverse when they go), but ... exactly how do I do that? Exactly which hooks I have to write?
Good question!
http://www.serverwatch.com/tutorials/article.php/3705216 Talks about a tool called "convmv" which will fix filenames. This might be helpful.
Iconv http://www.gnu.org/software/libiconv/ can convert arbitrary text into different character sets.
http://ozmm.org/posts/git_post_commit_for_profit.html Tells you how to go about making a post-commit hook, more Ruby-specific though. It looks like you just add a script to execute in .git/hooks/post-commit, and git will run it after you commit. It could be a script that even runs a script in your git repo.
For the script, I would recommend just scanning with find, convert the filename to UTF-8, see if it's already that name, and if not, move it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With