You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <be...@qqmail.nl> on 2013/02/24 18:59:20 UTC

RE: svn add and inconsistent line endings.


> -----Original Message-----
> From: Branko Čibej [mailto:brane@wandisco.com]
> Sent: zondag 24 februari 2013 17:31
> To: dev@subversion.apache.org
> Subject: Re: svn add and inconsistent line endings
> 
> On 24.02.2013 17:00, Stefan Küng wrote:
> > On 24.02.2013 16:47, Bert Huijben wrote:
> >>
> >>
> >>> -----Original Message-----
> >>> From: Stefan Küng [mailto:tortoisesvn@gmail.com]
> >>> Sent: zondag 24 februari 2013 15:39
> >>> To: Subversion Development
> >>> Subject: svn add and inconsistent line endings
> >>>
> >>> Hi,
> >>>
> >>> When auto-props are set up for e.g., cpp files that set the
> >>> svn:eol-style property, adding those files is not possible if the file
> >>> has inconsistent line endings.
> >>> The --force flag won't help either, the only way to add the file is to
> >>> first fix the line endings in an editor.
> >>> Or add the file with --no-auto-props and then add the properties later.
> >>>
> >>> I think this situation is not good.
> >>> Maybe another param added to svn_client_add5 that ignores the EOL
> >>> check?
> >>> Or just pass the 'force' flag on to svn_wc__canonicalize_props()
> >>> instead
> >>> of passing 'false' unconditionally in libsvn_wc\adm_ops.c,
> >>> svn_wc_add_from_disk2() ?
> >>
> >> I don't think simply ignoring this and allowing the add to continue is a
> >> good enough solution.
> >>
> >> Just passing the skip checks flags will allow adding many wrong
> >> properties
> >> which will cause a lot of grief later, and I would guess adding the file
> >> would just delay the error until we try to commit this file.
> >>
> >>
> >> But looking at this from the AnkhSVN side, I would like to have some
> >> api to
> >> make the eols on files consistent... Would this work for you?
> >
> > The API already exists, since when passing the --force flag to the
> > propset command (adding the svn:eol-style property), then the file is
> > automatically adjusted.
> >
> > I agree that the add command should still check the other properties.
> > So why not add a separate flag to only skip the EOL check?
> > Or maybe just automatically adjust the EOLs when adding the file? I
> > never understood why that check is there.
> 
> I'd say that "force" should always do the same thing for equivalent
> cases, so in this case, it should tell the library to adjust line
> endings, if that's what "svn propset" does. Autoprops should behave
> exactly as if a series of propsets were issued.

svn add --force allows not failing on already versioned files. It is not passed further into the api.

You suggestion of --force should just be handed down to be equivalent, makes --force a global 'feel free to break any assumptions' flag, and that is why in general we are deprecating --force. 
(We should introduce specific arguments when overrides are necessary. Such as we did on 'svn merge', 'svn switch', etc.)

	Bert

> 
> -- Brane
> 
> --
> Branko Čibej
> Director of Subversion | WANdisco | www.wandisco.com



Re: svn add and inconsistent line endings.

Posted by Branko Čibej <br...@wandisco.com>.
On 24.02.2013 18:59, Bert Huijben wrote:
>
>> -----Original Message-----
>> From: Branko Čibej [mailto:brane@wandisco.com]
>> Sent: zondag 24 februari 2013 17:31
>> To: dev@subversion.apache.org
>> Subject: Re: svn add and inconsistent line endings
>>
>> On 24.02.2013 17:00, Stefan Küng wrote:
>>> On 24.02.2013 16:47, Bert Huijben wrote:
>>>>
>>>>> -----Original Message-----
>>>>> From: Stefan Küng [mailto:tortoisesvn@gmail.com]
>>>>> Sent: zondag 24 februari 2013 15:39
>>>>> To: Subversion Development
>>>>> Subject: svn add and inconsistent line endings
>>>>>
>>>>> Hi,
>>>>>
>>>>> When auto-props are set up for e.g., cpp files that set the
>>>>> svn:eol-style property, adding those files is not possible if the file
>>>>> has inconsistent line endings.
>>>>> The --force flag won't help either, the only way to add the file is to
>>>>> first fix the line endings in an editor.
>>>>> Or add the file with --no-auto-props and then add the properties later.
>>>>>
>>>>> I think this situation is not good.
>>>>> Maybe another param added to svn_client_add5 that ignores the EOL
>>>>> check?
>>>>> Or just pass the 'force' flag on to svn_wc__canonicalize_props()
>>>>> instead
>>>>> of passing 'false' unconditionally in libsvn_wc\adm_ops.c,
>>>>> svn_wc_add_from_disk2() ?
>>>> I don't think simply ignoring this and allowing the add to continue is a
>>>> good enough solution.
>>>>
>>>> Just passing the skip checks flags will allow adding many wrong
>>>> properties
>>>> which will cause a lot of grief later, and I would guess adding the file
>>>> would just delay the error until we try to commit this file.
>>>>
>>>>
>>>> But looking at this from the AnkhSVN side, I would like to have some
>>>> api to
>>>> make the eols on files consistent... Would this work for you?
>>> The API already exists, since when passing the --force flag to the
>>> propset command (adding the svn:eol-style property), then the file is
>>> automatically adjusted.
>>>
>>> I agree that the add command should still check the other properties.
>>> So why not add a separate flag to only skip the EOL check?
>>> Or maybe just automatically adjust the EOLs when adding the file? I
>>> never understood why that check is there.
>> I'd say that "force" should always do the same thing for equivalent
>> cases, so in this case, it should tell the library to adjust line
>> endings, if that's what "svn propset" does. Autoprops should behave
>> exactly as if a series of propsets were issued.
> svn add --force allows not failing on already versioned files. It is not passed further into the api.
>
> You suggestion of --force should just be handed down to be equivalent, makes --force a global 'feel free to break any assumptions' flag, and that is why in general we are deprecating --force. 
> (We should introduce specific arguments when overrides are necessary. Such as we did on 'svn merge', 'svn switch', etc.)


That implies adding specific flags for any possible autoprop that might
need a nudge. That sounds ... awful. It's almost better to automatically
adjust the line endings.

It would be better to configure such behaviour in the autoprops config,
e.g., telling it to

    svn:eol-style=crlf/force

or something similar. I wouldn't mind an extension of the autoprops
syntax that allowed users to add certain propset options to the propery
specs.

-- Brane

-- 
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com