dev@glassfish.java.net

Re: ^M char in files

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Thu, 03 Apr 2008 19:29:06 -0700

So to be clear, everyone should change their $HOME/.subversion/config
file to contain these to lines (at least):

enable-auto-props = yes

*.java = svn:eol-style=native

I think this applies to non-windows users also as the documentation
states that file w/ only LF can confuse windows programs (I think
notepad may be one of them). Native means it will store it on the
server as LF, but will convert it to CRLF or LF as appropriate for
people to view.

For existing files, the find command Claudio suggested can add the
eol-style property (I think that command may have found binary files
which may corrupt them?? perhaps this one is safer):

    find . -name "*.java" -exec svn propset svn:eol-style 'native' \{} \;

(NOTE: depending on your shell the escaping might be different.)

Is all that correct? If so, we should put this on the GF wiki.

Ken


Sahoo wrote:
> Thanks, Claudio. Yes, I was exactly referring to this in my last
> reply. Let's hope Windows users use something like this going forward.
>
> Thanks,
> Sahoo
>
> Claudio Miranda wrote:
>> Those properties can be configured at svn client level, as you
>> requested, see an example extracted from $HOME/.subversion/config
>>
>> ### Section for configuring automatic properties.
>> [auto-props]
>> ### The format of the entries is:
>> ### file-name-pattern = propname[=value][;propname[=value]...]
>> ### The file-name-pattern can contain wildcards (such as '*' and
>> ### '?'). All entries which match will be applied to the file.
>> ### Note that auto-props functionality must be enabled, which
>> ### is typically done by setting the 'enable-auto-props' option.
>> # *.c = svn:eol-style=native
>> # *.cpp = svn:eol-style=native
>> # *.h = 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
>> # Makefile = svn:eol-style=native
>>
>> Claudio Miranda
>>
>> On Thu, Apr 3, 2008 at 11:35 AM, Sahoo <Sahoo_at_sun.com> wrote:
>>
>>> Thanks, Claudio. When new files are added, we have to again set the
>>> properties, right? Can user use the auto-props setting in their svn
>>> client
>>> for all .java, .xml and other known extensions? That way, when new
>>> files
>>> are added, they are automatically taken care of.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>