Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #41485] [TODO] Add a test for svn:eol-style property

3 views
Skip to first unread message

Paul Cochrane

unread,
Feb 11, 2007, 7:51:22 AM2/11/07
to bugs-bi...@rt.perl.org
# New Ticket Created by Paul Cochrane
# Please include the string: [perl #41485]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41485 >


chromatic asked me recently whether or not a subversion property
exists for line endings to help keep text files consistent within the
repository. It turns out there is, namely the svn:eol-style property.
This should be set to "LF" so that one has Unix-style end-of-line
characters. I have added a test for this into
t/codingstd/line_endings.t but before I commit it, I thought I'd check
if having all text files have this property set was appropriate
(especially for Windows users).

If noone complains then I'll commit the change, and close this ticket.

Regards,

Paul

Jerry Gay

unread,
Feb 12, 2007, 11:23:48 AM2/12/07
to perl6-i...@perl.org, bugs-bi...@rt.perl.org
svn:eol-style should be set to 'native', so it'll save files with the
line ending the platform expects. the only exceptions i'm aware of are
examples using file io. as the tests are currently designed, these
require svn:eol-style=LF (see t/examples/streams.t for more.)

if you want to make sure this test is platform-friendly before
committing, feel free to attach the patch to this ticket, and i'll run
it on windows.
~jerry

Jonathan Worthington

unread,
Feb 13, 2007, 11:07:26 AM2/13/07
to Paul Cochrane, jerry gay, perl6-i...@perl.org, bugs-bi...@rt.perl.org
Paul Cochrane wrote:
> Do users on Windows have major problems editing the
> files because they're all (mostly) UNIX line endings?
Yes. Even things I may use that can handle input with UNIX line endings,
tend to spit out files with Windows line endings too. I rely on
eol-style being set to native for this all to work out, and when I edit
files without it set someone probably make an "OH NO \r's everywhere"
kinda comment in my direction. :-)

> Should we
> change the coding standard test to look just for text files with the
> eol-style set to native, and not worry about DOS/UNIX etc line
> endings?
I think native should just do the right thing and be set on almost every
file - many files are set with this property already.

If you're checking out on a UNIX platform and seeing things with a
DOS/Windows line ending, that's probably an issue (a few select test
files aside, I guess). But on a DOS/Windows platform, it should be the
common case and it's the UNIX endings that are the problem. Both of
these point to forgetting to set eol-style to native.

Thanks,

Jonathan

James E Keenan

unread,
Feb 13, 2007, 9:12:58 PM2/13/07
to perl6-i...@perl.org, jerry gay, perl6-i...@perl.org, bugs-bi...@rt.perl.org
jerry gay wrote:
> On 2/11/07, via RT Paul Cochrane <parrotbug...@parrotcode.org> wrote:
>
>> # New Ticket Created by Paul Cochrane
>> # Please include the string: [perl #41485]
>> # in the subject line of all future correspondence about this issue.
>> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41485 >
>>
>>
> svn:eol-style should be set to 'native', so it'll save files with the
> line ending the platform expects. the only exceptions i'm aware of are
> examples using file io. as the tests are currently designed, these
> require svn:eol-style=LF (see t/examples/streams.t for more.)
>


Apropos the discussion in this thread, should any svn properties be set
on files submitted as patches or new files?

Or is this not relevant, as such files cannot yet have svn properties?

But perhaps more to the point: Suppose that I am committing new files
to a *branch* (e.g., the buildtools branch) -- files that ultimately
will be submitted to the project as patches/new files to *trunk*. What
svn properties should I set on files I'm committing to my branch?

(So far, I'm just adding 'svn:keywords "Id"', because otherwise I don't
get proper updates in my svn Id tags.)

kid51

Jerry Gay

unread,
Feb 13, 2007, 9:37:34 PM2/13/07
to James E Keenan, perl6-i...@perl.org, bugs-bi...@rt.perl.org
the metadata requirements for parrot repo files are poorly documented.
there's a little info in docs/submissions.pod, and a little at
http://www.parrotcode.org/source.html. if you count tests as
documentation (i do,) then t/distro/file_metadata.t is another place
to look.

the documentation for file metadata is not well organized, nor
complete. i'm not certain where this info best fits, but the coding
standard pdd seems like a good candidate. in any case, the general
rule (there are exceptions) is that the following properties have the
following settings on the listed filetypes:
[*.*]: svn:eol-style=native
[*.*]: svn:keywords="Author Date Id Revision"
[*.t]: svn:mime-type=text/plain

and hopefully someday svn will support custom keywords (it's been
threatened for years) and we can add "Year" and/or "Copyright" -- but
that's another story.

the cleanup and organization of documentation related to svn
properties should be tracked in a separate ticket.
~jerry

jerry gay

unread,
Feb 14, 2007, 10:21:05 AM2/14/07
to Paul Cochrane, James E Keenan, perl6-i...@perl.org, bugs-bi...@rt.perl.org
On 2/14/07, Paul Cochrane <paultc...@gmail.com> wrote:
> > the documentation for file metadata is not well organized, nor
> > complete. i'm not certain where this info best fits, but the coding
> > standard pdd seems like a good candidate. in any case, the general
> > rule (there are exceptions) is that the following properties have the
> > following settings on the listed filetypes:
> > [*.*]: svn:eol-style=native
> > [*.*]: svn:keywords="Author Date Id Revision"
> > [*.t]: svn:mime-type=text/plain
>
> What are the exceptions? I've only been able to find
> 'examples/pasm/small.xml', which is set to LF.

>
> > the cleanup and organization of documentation related to svn
> > properties should be tracked in a separate ticket.
> Submitted as #41505
>
thanks!

> Attached is a patch to t/codingstd/line_endings.t which searches for
> text files which have no eol-style property set, or it isn't set to
> 'native'. If people are happy with it, I'll commit it in the next
> couple of days.
>
the body of the patch looks good, but it belongs in
t/distro/file_metadata.t with the other metadata-related tests.
~jerry

Paul Cochrane

unread,
Feb 14, 2007, 10:42:40 AM2/14/07
to jerry gay, James E Keenan, perl6-i...@perl.org, bugs-bi...@rt.perl.org
> > Attached is a patch to t/codingstd/line_endings.t which searches for
> > text files which have no eol-style property set, or it isn't set to
> > 'native'. If people are happy with it, I'll commit it in the next
> > couple of days.
> >
> the body of the patch looks good, but it belongs in
> t/distro/file_metadata.t with the other metadata-related tests.

Ok, committed to t/distro/file_metadata.t in r16981.

Paul

Paul Cochrane via RT

unread,
Feb 14, 2007, 10:50:16 AM2/14/07
to perl6-i...@perl.org
Resolved as of r16981
0 new messages