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

Git bug. gitattributes' pattern does not respect spaces in the filenames

From
Alexey Shumkin <alex.crezoff@gmail.com>
Date
Oct 10, 2011, 07:02 UTC
Message-ID
<20111010110221.38e9985a@ashu.dyn.rarus.ru>
Hello everyone!

There's a description for the understanding of a situation. I have a project on Windows. I use Git under Cygwin. There are some *.xml in the project. But some of them are in cp1251 encoding, another ones are in UTF-8. For the first ones there is no need of any conversion to see the git-diff, but for the *.xml's in UTF-8 I set

*.xml diff=utf8-to-cp1251

And according to this I have $ git config diff.utf8-to-cp1251.textconv 'iconv -f utf-8 -t cp1251'

Unfortunately, *.xml's in cp1251 DOES match this pattern, too. As far as cp1251 and UTF-8 files are in different folders, it is logically enough to set pattern like

<folder with a UTF-8-xmls>/*.xml diff=utf8-to-cp1251

for the UTF-8 files. BUT! Unfortunately, <folder with a UTF-8-xmls> have spaces in its name, so textconv filter does not work because of error of parsing .gitattributes

I have no enough skills to patch Git to fix this error. Is anybody interested in to do?

Thanks
Next: Junio C Hamano
Message 1 of 3 in “Git bug. gitattributes' pattern does not respect spaces in the filenames”
  1. Alexey ShumkinOct 10, 2011
  2. Junio C HamanoOct 10, 2011
  3. Alexey ShumkinOct 10, 2011

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.