You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by baz themail <ba...@gmail.com> on 2008/09/20 18:29:13 UTC

problems with checking a text file: svn thinks that it is a binary

Hi,

When adding a new dos text file with extension ".txt", svn thinks that it is
a binary. Is there anyway to configure that? Is it mime-type related?

Thank you.

A.

Re: problems with checking a text file: svn thinks that it is a binary

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Ryan Schmidt wrote on Sat, 20 Sep 2008 at 14:42 -0500:
> On Sep 20, 2008, at 2:04 PM, Daniel Shahaf wrote:
> 
> > steveking wrote on Sat, 20 Sep 2008 at 20:48 +0200:
> > > Karl Fogel wrote:
> > > > "baz themail" <ba...@gmail.com> writes:
> > > > > When adding a new dos text file with extension ".txt", svn thinks that
> > > > > it is a
> > > > > binary. Is there anyway to configure that? Is it mime-type related?
> > > > 
> > > >  'svn propset svn:mime-type text/plain yourfile.txt'
> > > 
> > > Be careful with that. A text file can be encoded in utf-16 (unicode),
> > > and Subversion can't handle that as text.
> >                 ^^^^^^^^^^^^^^^^^^^^^^^^^
> > 
> > A quick test shows that 'svn diff' doesn't blow up on a UTF-16 file, so
> > I'm not sure what you mean by "can't handle as text".  Could you give an
> > example?
> 
> There has been an issue open for some time:
> 
> http://subversion.tigris.org/issues/show_bug.cgi?id=2194
> 

Found plenty of examples in the thread there.  Thanks for the pointer.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: problems with checking a text file: svn thinks that it is a binary

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 20, 2008, at 2:04 PM, Daniel Shahaf wrote:

> steveking wrote on Sat, 20 Sep 2008 at 20:48 +0200:
>> Karl Fogel wrote:
>>> "baz themail" <ba...@gmail.com> writes:
>>>> When adding a new dos text file with extension ".txt", svn  
>>>> thinks that it is a
>>>> binary. Is there anyway to configure that? Is it mime-type related?
>>>
>>>   'svn propset svn:mime-type text/plain yourfile.txt'
>>
>> Be careful with that. A text file can be encoded in utf-16 (unicode),
>> and Subversion can't handle that as text.
>                  ^^^^^^^^^^^^^^^^^^^^^^^^^
>
> A quick test shows that 'svn diff' doesn't blow up on a UTF-16  
> file, so
> I'm not sure what you mean by "can't handle as text".  Could you  
> give an
> example?

There has been an issue open for some time:

http://subversion.tigris.org/issues/show_bug.cgi?id=2194




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: problems with checking a text file: svn thinks that it is a binary

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Please reply to the list.  And please reply to a relevant post in the 
thread (your question was not related to the post you replied to).

baz themail wrote on Sat, 20 Sep 2008 at 12:32 -0700:
> Is there a way to automate it rather than doing it per file and per user
> configuration basis?
> 

Use auto-props.

Daniel

> On Sat, Sep 20, 2008 at 12:04 PM, Daniel Shahaf <d....@daniel.shahaf.name>wrote:
> 
> > steveking wrote on Sat, 20 Sep 2008 at 20:48 +0200:
> > > Karl Fogel wrote:
> > > > "baz themail" <ba...@gmail.com> writes:
> > > >> When adding a new dos text file with extension ".txt", svn thinks that
> > it is a
> > > >> binary. Is there anyway to configure that? Is it mime-type related?
> > > >
> > > >   'svn propset svn:mime-type text/plain yourfile.txt'
> > >
> > > Be careful with that. A text file can be encoded in utf-16 (unicode),
> > > and Subversion can't handle that as text.
> >                 ^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > A quick test shows that 'svn diff' doesn't blow up on a UTF-16 file, so
> > I'm not sure what you mean by "can't handle as text".  Could you give an
> > example?
> >
> > Thanks,
> >
> > Daniel
> >
> > > If your file is unicode, then
> > > you have to live with the fact that Subversion treats it as binary.
> > > And then don't set the svn:mime-type property to text/plain!
> > >
> > > Stefan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> >
> >
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: problems with checking a text file: svn thinks that it is a binary

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 20, 2008, at 2:54 PM, baz themail wrote:

> I am going through the svn-book.pdf and I cannot understand how to  
> set the auto properties, thats why i send the question to the group  
> and hoping to find some help.

http://svnbook.red-bean.com/en/1.5/ 
svn.advanced.props.html#svn.advanced.props.auto

In the config file, you set "enable-auto-props = yes", and then edit  
the mappings in the [auto-props] section.


>  I see that it mention the "config" file but where is it located? I  
> cannot find it from the standard server installation for 1.5.2. I  
> am not sure if the book mention it or not.

http://svnbook.red-bean.com/en/1.5/ 
svn.advanced.confarea.html#svn.advanced.confarea.layout

"The first time the svn command-line client is executed, it creates a  
per-user configuration area. On Unix-like systems, this area appears  
as a directory named .subversion in the user's home directory. On  
Win32 systems, Subversion creates a folder named Subversion,  
typically inside the Application Data area of the user's profile  
directory (which, by the way, is usually a hidden directory).  
However, on this platform, the exact location differs from system to  
system and is dictated by the Windows Registry."



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: problems with checking a text file: svn thinks that it is a binary

Posted by baz themail <ba...@gmail.com>.
I am going through the svn-book.pdf and I cannot understand how to set the
auto properties, thats why i send the question to the group and hoping to
find some help.

I see that it mention the "config" file but where is it located? I cannot
find it from the standard server installation for 1.5.2. I am not sure if
the book mention it or not.

Daniel, I didnt mean to reply you directly. I was just hitting the reply
button.




>
>
>

Re: problems with checking a text file: svn thinks that it is a binary

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
steveking wrote on Sat, 20 Sep 2008 at 20:48 +0200:
> Karl Fogel wrote:
> > "baz themail" <ba...@gmail.com> writes:
> >> When adding a new dos text file with extension ".txt", svn thinks that it is a
> >> binary. Is there anyway to configure that? Is it mime-type related?
> > 
> >   'svn propset svn:mime-type text/plain yourfile.txt'
> 
> Be careful with that. A text file can be encoded in utf-16 (unicode),
> and Subversion can't handle that as text.
                 ^^^^^^^^^^^^^^^^^^^^^^^^^

A quick test shows that 'svn diff' doesn't blow up on a UTF-16 file, so 
I'm not sure what you mean by "can't handle as text".  Could you give an 
example?

Thanks,

Daniel

> If your file is unicode, then
> you have to live with the fact that Subversion treats it as binary.
> And then don't set the svn:mime-type property to text/plain!
> 
> Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: problems with checking a text file: svn thinks that it is a binary

Posted by steveking <st...@gmx.ch>.
Karl Fogel wrote:
> "baz themail" <ba...@gmail.com> writes:
>> When adding a new dos text file with extension ".txt", svn thinks that it is a
>> binary. Is there anyway to configure that? Is it mime-type related?
> 
>   'svn propset svn:mime-type text/plain yourfile.txt'

Be careful with that. A text file can be encoded in utf-16 (unicode),
and Subversion can't handle that as text. If your file is unicode, then
you have to live with the fact that Subversion treats it as binary.
And then don't set the svn:mime-type property to text/plain!

Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: problems with checking a text file: svn thinks that it is a binary

Posted by Karl Fogel <kf...@red-bean.com>.
"baz themail" <ba...@gmail.com> writes:
> When adding a new dos text file with extension ".txt", svn thinks that it is a
> binary. Is there anyway to configure that? Is it mime-type related?

  'svn propset svn:mime-type text/plain yourfile.txt'

Best,
-Karl


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: problems with checking a text file: svn thinks that it is a binary

Posted by David Weintraub <qa...@gmail.com>.
As others have said, you can use the "mime-type". However, I wonder if
using "svn:eol-type=share" might be a better bet. Is the problem that
the file you're looking at is Unicode format, or is it due to the fact
that DOS text files end with a CTRL-Z?

The ".subversion" directory on Windows machines is located in the
%USERPROFILE% directory which in XP is normally the "C:\Documents and
Settings\<login>" directory. In Vista, I think it might be the
"C:\Home\<login>" directory.

Under the .subversion directory is the config file that contains the
settings for auto-properties, but before you do anything, try to
determine exactly what it doesn't like about your DOS text files: Is
it because they're in Unicode or because of the CTRL-Z at the end of
the file? I import files created on Windows XP machines without these
problems. But, most of these files were created with Eclipse, Textpad,
VIM, or another type of development style text editor.

Just curious, how are these text files being created?

--
David Weintraub
qazwart@gmail.com



On Sat, Sep 20, 2008 at 2:29 PM, baz themail <ba...@gmail.com> wrote:
> Hi,
>
> When adding a new dos text file with extension ".txt", svn thinks that it is
> a binary. Is there anyway to configure that? Is it mime-type related?
>
> Thank you.
>
> A.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org