* git adds some text file as binary file by mistake
@ 2008-10-24 12:37 Ping Yin
2008-10-24 12:54 ` Michael J Gruber
0 siblings, 1 reply; 7+ messages in thread
From: Ping Yin @ 2008-10-24 12:37 UTC (permalink / raw)
To: Git Mailing List
So what should i do if i want it added as text file?
--
Ping Yin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: git adds some text file as binary file by mistake
2008-10-24 12:37 git adds some text file as binary file by mistake Ping Yin
@ 2008-10-24 12:54 ` Michael J Gruber
2008-10-24 13:30 ` Ping Yin
0 siblings, 1 reply; 7+ messages in thread
From: Michael J Gruber @ 2008-10-24 12:54 UTC (permalink / raw)
To: Ping Yin; +Cc: Git Mailing List
Ping Yin venit, vidit, dixit 24.10.2008 14:37:
> So what should i do if i want it added as text file?
You should give us more detail on the file ;)
What's the extension, what's the typical content? It may be a simple
matter of specifying attributes.
Do ordinary diff and grep recognize your files as text?
Michael
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: git adds some text file as binary file by mistake
2008-10-24 12:54 ` Michael J Gruber
@ 2008-10-24 13:30 ` Ping Yin
2008-10-24 13:34 ` Bruce Stephens
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ping Yin @ 2008-10-24 13:30 UTC (permalink / raw)
To: Michael J Gruber; +Cc: Git Mailing List
On Fri, Oct 24, 2008 at 8:54 PM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> Ping Yin venit, vidit, dixit 24.10.2008 14:37:
>> So what should i do if i want it added as text file?
>
> You should give us more detail on the file ;)
> What's the extension, what's the typical content? It may be a simple
> matter of specifying attributes.
> Do ordinary diff and grep recognize your files as text?
>
> Michael
>
It's just an xml file. I guess maybe there are some hidden characters
at the beginning. I will figure it out later because i have no access
to that file right now.
I'm just ask this problem in general sense. So is there a general way
to specify whether a file is text or binary?
--
Ping Yin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: git adds some text file as binary file by mistake
2008-10-24 13:30 ` Ping Yin
@ 2008-10-24 13:34 ` Bruce Stephens
2008-10-24 13:51 ` Michael J Gruber
2008-10-30 6:32 ` Ping Yin
2 siblings, 0 replies; 7+ messages in thread
From: Bruce Stephens @ 2008-10-24 13:34 UTC (permalink / raw)
To: Ping Yin; +Cc: Michael J Gruber, Git Mailing List
"Ping Yin" <pkufranky@gmail.com> writes:
[...]
> I'm just ask this problem in general sense. So is there a general way
> to specify whether a file is text or binary?
Yes: gitattributes(5).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: git adds some text file as binary file by mistake
2008-10-24 13:30 ` Ping Yin
2008-10-24 13:34 ` Bruce Stephens
@ 2008-10-24 13:51 ` Michael J Gruber
2008-10-30 6:32 ` Ping Yin
2 siblings, 0 replies; 7+ messages in thread
From: Michael J Gruber @ 2008-10-24 13:51 UTC (permalink / raw)
To: Ping Yin; +Cc: Git Mailing List
Ping Yin venit, vidit, dixit 24.10.2008 15:30:
> On Fri, Oct 24, 2008 at 8:54 PM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>> Ping Yin venit, vidit, dixit 24.10.2008 14:37:
>>> So what should i do if i want it added as text file?
>> You should give us more detail on the file ;)
>> What's the extension, what's the typical content? It may be a simple
>> matter of specifying attributes.
>> Do ordinary diff and grep recognize your files as text?
>>
>> Michael
>>
>
> It's just an xml file. I guess maybe there are some hidden characters
> at the beginning. I will figure it out later because i have no access
> to that file right now.
Maybe it's in an encoding which is not available on the machine you're
using git on?
> I'm just ask this problem in general sense. So is there a general way
> to specify whether a file is text or binary?
Bruce suggested a good read. To save you some time: You want to say
*.xml diff
or
*.xml diff crlf
in one of the attributes files, depending on whether you want git to
possibly translate line endings (which depends on other settings also).
Note that the "content type" of the file plays a role only for diffs and
stats, not for the actual storage (except for, possibly, crlf conversion).
Cheers,
Michael
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: git adds some text file as binary file by mistake
2008-10-24 13:30 ` Ping Yin
2008-10-24 13:34 ` Bruce Stephens
2008-10-24 13:51 ` Michael J Gruber
@ 2008-10-30 6:32 ` Ping Yin
2008-10-31 0:29 ` Robin Rosenberg
2 siblings, 1 reply; 7+ messages in thread
From: Ping Yin @ 2008-10-30 6:32 UTC (permalink / raw)
To: Michael J Gruber; +Cc: Git Mailing List
On Fri, Oct 24, 2008 at 9:30 PM, Ping Yin <pkufranky@gmail.com> wrote:
> On Fri, Oct 24, 2008 at 8:54 PM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>> Ping Yin venit, vidit, dixit 24.10.2008 14:37:
>>> So what should i do if i want it added as text file?
>>
>> You should give us more detail on the file ;)
>> What's the extension, what's the typical content? It may be a simple
>> matter of specifying attributes.
>> Do ordinary diff and grep recognize your files as text?
>>
>> Michael
>>
>
> It's just an xml file. I guess maybe there are some hidden characters
> at the beginning. I will figure it out later because i have no access
> to that file right now.
>
> Ping Yin
>
I have figured it out. It's just because the BOM characters feff00 in
the beginning of the utf-8 xml file.
--
Ping Yin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: git adds some text file as binary file by mistake
2008-10-30 6:32 ` Ping Yin
@ 2008-10-31 0:29 ` Robin Rosenberg
0 siblings, 0 replies; 7+ messages in thread
From: Robin Rosenberg @ 2008-10-31 0:29 UTC (permalink / raw)
To: Ping Yin; +Cc: Michael J Gruber, Git Mailing List
torsdagen den 30 oktober 2008 07.32.47 skrev Ping Yin:
> On Fri, Oct 24, 2008 at 9:30 PM, Ping Yin <pkufranky@gmail.com> wrote:
> > On Fri, Oct 24, 2008 at 8:54 PM, Michael J Gruber
> > <git@drmicha.warpmail.net> wrote:
> >> Ping Yin venit, vidit, dixit 24.10.2008 14:37:
> >>> So what should i do if i want it added as text file?
> >>
> >> You should give us more detail on the file ;)
> >> What's the extension, what's the typical content? It may be a simple
> >> matter of specifying attributes.
> >> Do ordinary diff and grep recognize your files as text?
> >>
> >> Michael
> >>
> >
> > It's just an xml file. I guess maybe there are some hidden characters
> > at the beginning. I will figure it out later because i have no access
> > to that file right now.
> >
> > Ping Yin
> >
>
> I have figured it out. It's just because the BOM characters feff00 in
> the beginning of the utf-8 xml file.
The UTF-8 BOM is EF BB BF, (no NUL.). FEFF is UTF-16 BE (and the third
byte would be 00 for an XML file). I think git currently regards just about
any UTF-16 file as binary becuase of the NUL bytes.
-- robin
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-10-31 0:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-24 12:37 git adds some text file as binary file by mistake Ping Yin
2008-10-24 12:54 ` Michael J Gruber
2008-10-24 13:30 ` Ping Yin
2008-10-24 13:34 ` Bruce Stephens
2008-10-24 13:51 ` Michael J Gruber
2008-10-30 6:32 ` Ping Yin
2008-10-31 0:29 ` Robin Rosenberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).