Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply the svn 'eol-style' property recursively only on text files?

Tags:

shell

svn

I need to apply the eol-style property recursively on an existing repository. The repository contains both text files and binaries. I want to apply this property only on the text files, and not on the binary files. How can this be done from the command line or in a script?

like image 355
zr. Avatar asked Oct 26 '10 09:10

zr.


2 Answers

Something like

find . -name \*.txt -print0 | xargs -0 svn ps svn:eol-style native

to set svn:eol-style to native on all *.txt files.

like image 140
laalto Avatar answered Sep 22 '22 12:09

laalto


Take care, if you do this from a unix/linux environment, the checkin sees the whole file as changed. So as far as I know the only real solution is to do this on a windows machine, either with cygwin or tortoise (you can first search all files which need the eol-style property with agent ransack or other search tool, and select them all-> right click -> Tortoise SVN -> Properties -> new -> eol-style with value native (or if one of the files already have the property it shows up, select edit -> ok and all other files will also be modified).

like image 24
wdk Avatar answered Sep 22 '22 12:09

wdk