You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Dan Stromberg <ds...@gmail.com> on 2008/05/09 01:04:45 UTC

Is there any way to set an EOL style on svn:externals?

Is there any way to set an EOL style on svn:externals?  I know you can 
set it on a checked in file, but what about on another property?

I keep getting windows users checking in svn:externals changes with 
inconsistent line endings, and that makes "svn propget" and "svn 
propedit" choke.  I have automated processes that are doing "svn 
propget" followed by "svn propset" if there are changes, so it's 
probably just a matter of time until such an issue (which means svn 
propget fail to return the list of externals) causes an svn:externals 
update to be missed.

I have a case-by-case fix (vi .svn/dir-prop-base, remove the carriage 
returns, carefully adjust the preceding length to reflect the lower 
number of bytes - note that just using dos2unix or ftp in ascii mode 
doesn't work fully because of the length that needs to be adjusted), but 
is there a longer term fix?  One where I don't have to catch the problem 
in time?

Alternatively, and this is a distant second in desirability, is there a 
way of using a hook script that'll detect the inconsistent line endings 
and either fix them on the fly or at least reject the checkin?

Or should I just write something to automate the vi method I sketched 
above?  ISTR hearing that editing things under .svn is a Bad Thing, but 
if I'm doing it manually anyway...

And why does svn propget /care/ about the EOL inconsistency?  I 
understand why you wouldn't want to change the EOL convention on the fly 
for a regular file, but for svn:externals maybe it's not important to 
avoid auto-converting.

Thanks!


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

Re: Is there any way to set an EOL style on svn:externals?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 8, 2008, at 8:04 PM, Dan Stromberg wrote:

> Is there any way to set an EOL style on svn:externals?  I know you  
> can set it on a checked in file, but what about on another property?
>
> I keep getting windows users checking in svn:externals changes with  
> inconsistent line endings, and that makes "svn propget" and "svn  
> propedit" choke.  I have automated processes that are doing "svn  
> propget" followed by "svn propset" if there are changes, so it's  
> probably just a matter of time until such an issue (which means svn  
> propget fail to return the list of externals) causes an  
> svn:externals update to be missed.
>
> I have a case-by-case fix (vi .svn/dir-prop-base, remove the  
> carriage returns, carefully adjust the preceding length to reflect  
> the lower number of bytes - note that just using dos2unix or ftp in  
> ascii mode doesn't work fully because of the length that needs to  
> be adjusted), but is there a longer term fix?  One where I don't  
> have to catch the problem in time?
>
> Alternatively, and this is a distant second in desirability, is  
> there a way of using a hook script that'll detect the inconsistent  
> line endings and either fix them on the fly or at least reject the  
> checkin?
>
> Or should I just write something to automate the vi method I  
> sketched above?  ISTR hearing that editing things under .svn is a  
> Bad Thing, but if I'm doing it manually anyway...
>
> And why does svn propget /care/ about the EOL inconsistency?  I  
> understand why you wouldn't want to change the EOL convention on  
> the fly for a regular file, but for svn:externals maybe it's not  
> important to avoid auto-converting.

The only solution I'm aware of would be to write a pre-commit hook to  
check the svn:externals property of all committed files, and reject a  
commit if the line endings in the property are inconsistent. You  
cannot modify versioned properties (or versioned file contents) in a  
pre-commit hook.

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