{"thread":{"id":"28639","subject":"Git bug. gitattributes' pattern does not respect spaces in the filenames","startedAt":"2011-10-10T07:02:21Z","lastAt":"2011-10-10T15:51:45Z","messageCount":3,"participants":["Alexey Shumkin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"177301","messageId":"20111010110221.38e9985a@ashu.dyn.rarus.ru","threadId":"28639","inReplyTo":null,"subject":"Git bug. gitattributes' pattern does not respect spaces in the filenames","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2011-10-10T07:02:21Z","receivedAt":"2011-10-10T07:02:21Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"Hello everyone!\n\nThere's a description for the understanding of a\nsituation.\nI have a project on Windows. I use Git under Cygwin.\nThere are some *.xml in the project. But some of them are in cp1251\nencoding, another ones are in UTF-8. For the first ones there is no\nneed of any conversion to see the git-diff, but for the *.xml's in UTF-8\nI set\n\n*.xml diff=utf8-to-cp1251\n\nAnd according to this I have\n$ git config diff.utf8-to-cp1251.textconv 'iconv -f utf-8 -t cp1251'\n\nUnfortunately, *.xml's in cp1251 DOES match this pattern, too.\nAs far as cp1251 and UTF-8 files are in different folders,\nit is logically enough to set pattern like\n\n<folder with a UTF-8-xmls>/*.xml diff=utf8-to-cp1251\n\nfor the UTF-8 files.\nBUT!\nUnfortunately, <folder with a UTF-8-xmls> have spaces in its name,\nso textconv filter does not work because of error of\nparsing .gitattributes\n\nI have no enough skills to patch Git to fix this error.\nIs anybody interested in to do?\n\nThanks\n"},{"id":"177317","messageId":"7vipnwooh1.fsf@alter.siamese.dyndns.org","threadId":"28639","inReplyTo":"20111010110221.38e9985a@ashu.dyn.rarus.ru","subject":"Re: Git bug. gitattributes' pattern does not respect spaces in the filenames","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-10T15:28:26Z","receivedAt":"2011-10-10T15:28:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexey Shumkin <Alex.Crezoff@gmail.com> writes:\n\n> As far as cp1251 and UTF-8 files are in different folders,\n> it is logically enough to set pattern like\n>\n> <folder with a UTF-8-xmls>/*.xml diff=utf8-to-cp1251\n>\n> for the UTF-8 files.\n\n... IN the directory that needs conversion and not in the other one or at\nthe toplevel. Problem solved, no?\n\nAnother idea may be to use \"?\" in the directory part of the\npattern. Unless the directory structure is sick enough to have these\ndirectory names:\n\n\tdir-1/utf8-file.xml\n        dir 1/cp1251-file.xml\n\ndir?1/*.xml would match the matter, so...\n"},{"id":"177318","messageId":"20111010195145.0d1fc966@ashu.dyn.rarus.ru","threadId":"28639","inReplyTo":"7vipnwooh1.fsf@alter.siamese.dyndns.org","subject":"Re: Git bug. gitattributes' pattern does not respect spaces in the filenames","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2011-10-10T15:51:45Z","receivedAt":"2011-10-10T15:51:45Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"> Alexey Shumkin <Alex.Crezoff@gmail.com> writes:\n> \n> > As far as cp1251 and UTF-8 files are in different folders,\n> > it is logically enough to set pattern like\n> >\n> > <folder with a UTF-8-xmls>/*.xml diff=utf8-to-cp1251\n> >\n> > for the UTF-8 files.\n> \n> ... IN the directory that needs conversion and not in the other one\n> or at the toplevel. Problem solved, no?\nOh! yes! solved! thanks!\nI did not take into account that each folder can have\nits own .gitattributes-file\n\n> \n> Another idea may be to use \"?\" in the directory part of the\n> pattern. Unless the directory structure is sick enough to have these\n> directory names:\n> \n> \tdir-1/utf8-file.xml\n>         dir 1/cp1251-file.xml\n> \n> dir?1/*.xml would match the matter, so...\n\nhmm... I like more the case above :)\nbut TMTOWTDI principle rulez\n\nthanks again\n"}]}