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
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
> 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
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
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
> 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
Ok, committed to t/distro/file_metadata.t in r16981.
Paul