* Git bug. gitattributes' pattern does not respect spaces in the filenames
@ 2011-10-10 7:02 Alexey Shumkin
2011-10-10 15:28 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Shumkin @ 2011-10-10 7:02 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Git bug. gitattributes' pattern does not respect spaces in the filenames
2011-10-10 7:02 Git bug. gitattributes' pattern does not respect spaces in the filenames Alexey Shumkin
@ 2011-10-10 15:28 ` Junio C Hamano
2011-10-10 15:51 ` Alexey Shumkin
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2011-10-10 15:28 UTC (permalink / raw)
To: Alexey Shumkin; +Cc: git
Alexey Shumkin <Alex.Crezoff@gmail.com> writes:
> 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.
... IN the directory that needs conversion and not in the other one or at
the toplevel. Problem solved, no?
Another idea may be to use "?" in the directory part of the
pattern. Unless the directory structure is sick enough to have these
directory names:
dir-1/utf8-file.xml
dir 1/cp1251-file.xml
dir?1/*.xml would match the matter, so...
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Git bug. gitattributes' pattern does not respect spaces in the filenames
2011-10-10 15:28 ` Junio C Hamano
@ 2011-10-10 15:51 ` Alexey Shumkin
0 siblings, 0 replies; 3+ messages in thread
From: Alexey Shumkin @ 2011-10-10 15:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
> Alexey Shumkin <Alex.Crezoff@gmail.com> writes:
>
> > 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.
>
> ... IN the directory that needs conversion and not in the other one
> or at the toplevel. Problem solved, no?
Oh! yes! solved! thanks!
I did not take into account that each folder can have
its own .gitattributes-file
>
> Another idea may be to use "?" in the directory part of the
> pattern. Unless the directory structure is sick enough to have these
> directory names:
>
> dir-1/utf8-file.xml
> dir 1/cp1251-file.xml
>
> dir?1/*.xml would match the matter, so...
hmm... I like more the case above :)
but TMTOWTDI principle rulez
thanks again
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-10 15:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-10 7:02 Git bug. gitattributes' pattern does not respect spaces in the filenames Alexey Shumkin
2011-10-10 15:28 ` Junio C Hamano
2011-10-10 15:51 ` Alexey Shumkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox