You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alex Waugh <al...@alexwaugh.com> on 2003/03/03 21:32:22 UTC

propedit on svn:mime-type

Hi

If you do a svn propedit svn:mime-type on a file then it is quite likely
that after editing there will be a trailing newline. However, the
validation on the mimetype will reject the property if the final
character isn't alphanumeric. Wouldn't it be better if any trailing
(and leading?) whitespace was stripped before the validation?

If someone points me to the best place to do the stripping[1] then I
might be tempted to produce a patch.


Alex

[1] No, not that kind... ;-)

-- 
Alex Waugh                  alex@alexwaugh.com

RISC OS Software from http://www.alexwaugh.com/


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

Re: propedit on svn:mime-type

Posted by Branko Čibej <br...@xbc.nu>.
Greg Stein wrote:

>On Mon, Mar 03, 2003 at 11:29:48PM +0100, Branko Cibej wrote:
>  
>
>>...
>>Value translation for svn: propsis in
>>subversion/clients/cmdline/propset-cmd.c:svn_cl__propset, but I think
>>stripping leading and trailing whitespace (or clearing the value
>>altogether, in the case of svn:executable) should probably go into
>>subversion/libsvn_wc/props.c:svn_wc_prop_set, where we already do some
>>semantic checking on the props. My suggestion some time ago was:
>>    
>>
>
>+1 in concept
>
>  
>
>>    * svn:executable: Always make the value an empty string, since we
>>      only ever check if the property exists, we don't care about the value
>>    
>>
>
>I'd ask that it becomes something besides the empty string. Otherwise,
>'svn pl -v' will look awfully funny.
>  
>

Ah, good point.

Since "yes" and "true" are so overused, I suggest "och, aye". :-)

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


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

Re: propedit on svn:mime-type

Posted by Greg Stein <gs...@lyra.org>.
On Mon, Mar 03, 2003 at 11:29:48PM +0100, Branko Cibej wrote:
>...
> Value translation for svn: propsis in
> subversion/clients/cmdline/propset-cmd.c:svn_cl__propset, but I think
> stripping leading and trailing whitespace (or clearing the value
> altogether, in the case of svn:executable) should probably go into
> subversion/libsvn_wc/props.c:svn_wc_prop_set, where we already do some
> semantic checking on the props. My suggestion some time ago was:

+1 in concept

>     * svn:executable: Always make the value an empty string, since we
>       only ever check if the property exists, we don't care about the value

I'd ask that it becomes something besides the empty string. Otherwise,
'svn pl -v' will look awfully funny.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

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

Re: propedit on svn:mime-type

Posted by Branko Čibej <br...@xbc.nu>.
Karl Fogel wrote:

>Branko Čibej <br...@xbc.nu> writes:
>  
>
>>Value translation for svn: propsis in
>>subversion/clients/cmdline/propset-cmd.c:svn_cl__propset, but I think
>>stripping leading and trailing whitespace (or clearing the value
>>altogether, in the case of svn:executable) should probably go into
>>subversion/libsvn_wc/props.c:svn_wc_prop_set, where we already do some
>>semantic checking on the props. My suggestion some time ago was:
>>
>>    * svn:executable: Always make the value an empty string, since we
>>      only ever check if the property exists, we don't care about the value
>>    
>>
>
>This would make it look kind of weird in 'proplist' output, no?  Or in
>an editor?
>  
>
Yes, see the previous posts. I do think, though, that we should force a
single, constant value, even if it's just "+".

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


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

Re: propedit on svn:mime-type

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Branko Čibej <br...@xbc.nu> writes:
> Well, well, well. Didn't I propose that a long time ago, then got
> slammed down by the infamous Chicago Three to the tune that it was
> unnecessary? Revenge is sweet. :-)

I have no memory of slamming this down, but I've certainly done
stupider things.  Anyway, +1 :-).

> Value translation for svn: propsis in
> subversion/clients/cmdline/propset-cmd.c:svn_cl__propset, but I think
> stripping leading and trailing whitespace (or clearing the value
> altogether, in the case of svn:executable) should probably go into
> subversion/libsvn_wc/props.c:svn_wc_prop_set, where we already do some
> semantic checking on the props. My suggestion some time ago was:
> 
>     * svn:executable: Always make the value an empty string, since we
>       only ever check if the property exists, we don't care about the value

This would make it look kind of weird in 'proplist' output, no?  Or in
an editor?

-K

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

Re: propedit on svn:mime-type

Posted by Branko Čibej <br...@xbc.nu>.
Alex Waugh wrote:

>Hi
>
>If you do a svn propedit svn:mime-type on a file then it is quite likely
>that after editing there will be a trailing newline. However, the
>validation on the mimetype will reject the property if the final
>character isn't alphanumeric. Wouldn't it be better if any trailing
>(and leading?) whitespace was stripped before the validation?
>

Well, well, well. Didn't I propose that a long time ago, then got
slammed down by the infamous Chicago Three to the tune that it was
unnecessary? Revenge is sweet. :-)

>If someone points me to the best place to do the stripping[1] then I
>might be tempted to produce a patch.
>  
>
Value translation for svn: propsis in
subversion/clients/cmdline/propset-cmd.c:svn_cl__propset, but I think
stripping leading and trailing whitespace (or clearing the value
altogether, in the case of svn:executable) should probably go into
subversion/libsvn_wc/props.c:svn_wc_prop_set, where we already do some
semantic checking on the props. My suggestion some time ago was:

    * svn:executable: Always make the value an empty string, since we
      only ever check if the property exists, we don't care about the value
    * svn:mime-type, svn:eol-style: Strip all leading and trailing
      whitespace. I suggest looking at apr_collapse_spaces in
      apr_strings.h -- it might actually do the right thing.
    * svn:ignore, svn:externals: Make sure that the last line in the
      prop value ends in a newline.
    * svn:keywords: strip leading and trailing whitespace (but not
      internal whitespace!) Don't know about ending this value with a
      newline; IIRC; it must be a single line, so just stripping
      trailing spaces should be fine.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


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

Re: propedit on svn:mime-type

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: Mon, 03 Mar 2003 21:32:22 GMT
Alex Waugh said:

>If someone points me to the best place to do the stripping[1] then I
>might be tempted...
>
>
>Alex
>
>[1] No, not that kind... ;-)

Oh, thank the gods!  You had me worried there ;)
-- 

Seeya,
Paul
--
Key fingerprint = 1660 FECC 5D21 D286 F853  E808 BB07 9239 53F1 28EE

	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



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