You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Vincent Starre <th...@comcast.net> on 2005/07/19 19:20:23 UTC
Multiple issues related to eol-style, tangently perhaps
The first issue is with propget/set- what I was using to check/set
eol-style. If passed multiple arguments, propget dies as soon as it hits
one which is not under version control. This should be a warning, not
death. (directory with 500 files in it, 2 are not under version control,
do I really want to type them all out or do I want to say * and ignore
the warnings as they come?)
second: setting eol-syle to a file with mixed-types does not actually
set the eol-style. It produces a warning that the file has mixed
line-ending types, but it doesnt actually tell you "oh, and by the way,
I didnt do what you just told me to". If it's going to fail to commit
anyway, it should just wait until then to fail- set it for now!
third: I should be allowed to commit a file with
mixed-line-ending-types. This would probably involve adding new
eol-styles, such as:
CRLF-ignore-lone-CR
CRLF-remove-lone-CR
LF-ignore-lone-CR
LF-remove-lone-CR
CR-ignore-lone-LF
CR-remove-lone-LF
adding these as seperate lines such as:
CRLF
ignore-lone-CR
remove-lone-LF
would seem more intuitive and easier to manage to me- but it would
probably require more modification to the code than the other method
(not that I know anything about that)
I know it's not an issue which many people probably care about ("what's
wrong with you, mixing line-types in the first place?!"), but it /does/
happen and as s/\r?\n/\r\n/ is easy enough for me to type, it doesnt
seem like too much to ask as an option to have it happen automatically-
when explicitely stated.
fourth, and obviously not a real issue: why no explicite "binary"
eol-style? Sure, it's not needed, but I was thinking along the lines of
"make a cmmit hook that disallows commits of files without an eol-style,
but then there's one file that really is binary and really does need to
be named like that"
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Multiple issues related to eol-style, tangently perhaps
Posted by Seth Daniel <su...@sethdaniel.org>.
Vincent,
On Tue, Jul 19, 2005 at 03:20:23PM -0400, Vincent Starre wrote:
> The first issue is with propget/set- what I was using to check/set
> eol-style. If passed multiple arguments, propget dies as soon as it hits
> one which is not under version control. This should be a warning, not
> death. (directory with 500 files in it, 2 are not under version control,
> do I really want to type them all out or do I want to say * and ignore
> the warnings as they come?)
You didn't say what OS you were using. With the Bash shell on UNIX
systems that have Bash you can do something like this:
svn propset svn:eol-style native $(svn ls)
This will only set the given property for those files that are under
version control and will not even look at other files. I won't comment
on whether the current behavior is good or not since I have no opinion.
Other shells probably have similar ways of doing what I did above. The
point being that you can use 'svn ls' to find just the files that are
under version control.
I don't really know anything about your other questions. Sorry.
--
seth / @sethdaniel.org
Every morning, I get up and look through the 'Forbes' list of the
richest people in America. If I'm not there, I go to work.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Multiple issues related to eol-style, tangently perhaps
Posted by Vincent Starre <th...@comcast.net>.
(hit "reply" instead of "reply all", sorry)
Dale Worley wrote:
>> From: Vincent Starre [mailto:thebitman@comcast.net]
>>
>
>
> The first two points look sound to me.
>
>
>
>> third: I should be allowed to commit a file with
>> mixed-line-ending-types. This would probably involve adding new
>> eol-styles, such as:
>> CRLF-ignore-lone-CR
>> CRLF-remove-lone-CR
>> LF-ignore-lone-CR
>> LF-remove-lone-CR
>> CR-ignore-lone-LF
>> CR-remove-lone-LF
>>
>
>
> I don't see what these gain you over and above leaving svn:eol-style
> unset.
> The whole point of the "CR", "LF", and "CRLF" values is to
> enforce/check a
> particular style on a file. It strikes me as rare that these other
> combinations are needed in practice. (And you left off several
> possibilities, including "CRLF-ignore-lone-CR-remove-lone-LF", for
> instance.)
>
>
The point is: I always want files to be checked out as CRLF(*for
example). Once people I have no control over
get their hands on these files, they will often come back with CRLF
mixed with lone LF's. (often a result of vi
being used to make a quick change)
"native" partially corrects this, but forcing someone to use a single
operating system for each working copy seems
silly. (if they want to see what their change did to the unix build,
they would need to check back in and then update
a seperate copy, or risk eol-style errors when they find out "no, this
broke the unix build, I'll need to change this
one line" and open up vi)
simply not setting it is nothing at all like what I am seeking, either.
See the svnbook section on eol-style for an
explanation of why eol-style is a good thing. The point is: when
someone's editor mangles a file:
1) this can be easily detected(*svn already does this) and corrected,
it would be nice to have this happen on
commit rather than requiring it pre-commit.
2) if it can be easily detected and corrected, such corrections can
be accounted for and running svn diff should be
able to compare these files as they will be comitted (assuming
point 1)
nothing has been "left off"- I said "such as", meaning "here are a
couple examples", and it is obviously not a
complete list. But a complete list being something which would fast
become tedious, I offered a more-
comprehensive method directly below it:
> adding these as seperate lines such as:
> CRLF
> ignore-lone-CR
> remove-lone-LF
>
> would seem more...
but the first method would probably take less code, as I suspect
currently it's saying something along the lines of:
"CRLF? Okay, check to see that all CR and LF characters only come next
to eachother, scan the file and remove all CRs"
and the first method would merely add:
"CRLF-ignore-lone-LF? Okay, check to see that all CRs are next to LFs,
scan the file and remove all CRs"
"CRLF-remove-lone-CR? Okay, check to see that all LFs are next to CRs,
scan the file and remove all CRs"
etc
(*no, I have not actually looked at the code yet)
obviously this would count as data mangling, which is why it would need
to be explicitely set- of course, eol-style in
general is a form of data mangling, so that much doesnt sound like an
issue.
Of course, the one issue I can think of with this would be someone
sharing between MacOS, Unix, AND Windows. A
lone-CR and lone-LF could be seen as CRLF. To those people, I have no
solution. For those using only two styles of
line-endings, I have offered this.
>
>
>> fourth, and obviously not a real issue: why no explicite "binary"
>> eol-style? Sure, it's not needed, but I was thinking along the lines of
>> "make a cmmit hook that disallows commits of files without an eol-style,
>> but then there's one file that really is binary and really does need to
>> be named like that"
>>
>
>
> Is no-value insufficient?
>
>
No it is not. I really thought I had made that clear with "and obviously
not a real issue"
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: Multiple issues related to eol-style, tangently perhaps
Posted by Dale Worley <dw...@pingtel.com>.
> From: Vincent Starre [mailto:thebitman@comcast.net]
The first two points look sound to me.
> third: I should be allowed to commit a file with
> mixed-line-ending-types. This would probably involve adding new
> eol-styles, such as:
> CRLF-ignore-lone-CR
> CRLF-remove-lone-CR
> LF-ignore-lone-CR
> LF-remove-lone-CR
> CR-ignore-lone-LF
> CR-remove-lone-LF
I don't see what these gain you over and above leaving svn:eol-style unset.
The whole point of the "CR", "LF", and "CRLF" values is to enforce/check a
particular style on a file. It strikes me as rare that these other
combinations are needed in practice. (And you left off several
possibilities, including "CRLF-ignore-lone-CR-remove-lone-LF", for
instance.)
> fourth, and obviously not a real issue: why no explicite "binary"
> eol-style? Sure, it's not needed, but I was thinking along the lines of
> "make a cmmit hook that disallows commits of files without an eol-style,
> but then there's one file that really is binary and really does need to
> be named like that"
Is no-value insufficient?
You can cross-check it with svn:mime-type -- any type that starts with
"text/" is required to have an svn:eol-style. In our code base, we have a
rule:
http://www.sipfoundry.org/sipX/doc/coding-standard.html#ref2.9
"In order to ensure that files checked out from the repository have the
correct end-of-line characters for the platform onto which they are checked
out, every file in the respository must have the appropriate values for the
Subversion properties svn:mime-type and/or svn:eol-style.
"All "binary" files in the repository should have a valid, non-text MIME
media type specified for their svn:mime-type property. (If no other type is
suitable, "application/octet-stream" can be used.)
"All text files must have a "text/*" svn:mime-type property, and an
svn:eol-style property. Most text files are relevant to all platforms, and
should have the value "native" for the svn:eol-style property. This ensures
that a Subversion checkout will use the right end-of-line characters for the
host operating system."
And we have a script to enforce the rule:
http://scm.sipfoundry.org/rep/sipX/main/sipXpbx/doc/developer/eol-check.sh
Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org