[ZODB-Dev] Re: End-of-line translation problem

Jim Fulton jim at zope.com
Fri Apr 30 11:22:31 EDT 2004


Philipp von Weitershausen wrote:
> Jim,
> 

...

> What's the ad-hoc approach? I could imagine a hook script...

Leave it up to users (developers) to set the propprty on files they add.

>> For myself, I'm inclined to do what Tim suggested, and tell
>> subversion to automatically set the eol-style for all files to
>> native. This will fail loudly when binary files are checked in and I
>> think that I can deal with that inconvenience.
> 
> 
> That does not make sense. You'd only want svn to set that property on 
> text files anyway. So I don't understand what this "inconvenience" is.

This is explained in detail in the thread I gave a link to.

>> Note that this is a big improvement over CVS as generally, binary
>> files will automatically *not* be treated as text files. (The danger
>> being that the binary detection algorithm will occasionally fail.)
> 
> 
> I think that's very rare. It has never happened to me at least, and I 
> have lots of binary stuff like OpenOffice files in my repository.

Yup

>>>> [auto-props]
>>>> *.c = svn:eol-style=native
>>>> *.cpp = svn:eol-style=native
>>>> *.h = svn:eol-style=native
>>>> *.py = svn:eol-style=native
>>>> *.dsp = svn:eol-style=CRLF
>>>> *.dsw = svn:eol-style=CRLF
>>>> *.sh = svn:eol-style=native;svn:executable
>>>> *.txt = svn:eol-style=native
>>>> *.png = svn:mime-type=image/png
>>>> *.jpg = svn:mime-type=image/jpeg
> 
> 
> I wouldn't mind such a configuration. I would really make it the 
> responsbility of the committer. He/she may choose to use such settings 
> or simply set svn:eol-style after every 'svn add' manually.

That's the position the subversion developers take. Here's mine:

   [miscellany]
   enable-auto-props = yes

   [auto-props]
   * = svn:eol-style=native

This sets all files not detected to be binary to native eol style.
If a file is detected as binary, I get an error, but it is still added,
however, if this was a multi-file add, only the files up to an including
the first binary file will be added. I have to repeat the add command
for the remaining files.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the ZODB-Dev mailing list