This morning, when doing an svn up, almost every source file was updated, and was converted to DOS. What gives? And how do I revert this? Source files' formats should remain untouched by the SCM.
Bob Jamison wrote:
This morning, when doing an svn up, almost every source file was updated, and was converted to DOS. What gives? And how do I revert this? Source files' formats should remain untouched by the SCM.
Perhaps it could be these 4 revs (18077-18080) by pjrm:
http://inkscape.svn.sourceforge.net/viewvc/inkscape?view=rev&revision=18... http://inkscape.svn.sourceforge.net/viewvc/inkscape?view=rev&revision=18... http://inkscape.svn.sourceforge.net/viewvc/inkscape?view=rev&revision=18... http://inkscape.svn.sourceforge.net/viewvc/inkscape?view=rev&revision=18...
Aaron Spike
On Mon, Mar 31, 2008 at 09:46:58AM -0600, Bob Jamison wrote:
This morning, when doing an svn up, almost every source file was updated, and was converted to DOS. What gives? And how do I revert this? Source files' formats should remain untouched by the SCM.
The change in question is that I did
svn propset svn:eol-style native
on .cpp/.h files that were added since the last time all .cpp/.h files were set to svn:eol-style native.
The choices we have for this setting are:
- Unset. In this case, files tend to get a mix of CRLF and LF endings in the one file over time -- as was the case with half a dozen or so files when I made the change.
- `native'. In this case, LF is used on Un*x (including MacOS X), while CRLF is used on Windows. (I don't know for sure what happens for svn compiled under cygwin, but I'd guess it would use CRLF.)
- `LF', `CRLF' or `CR', with the obvious meaning for checkouts.
On Un*x (incl. MacOS X) for normal source files (and shell scripts and makefiles and human-readable text files such as readme's, todo's, ChangeLog etc.), we certainly prefer for LF to be used.
On Windows, it's a bit less clear. Heavy users of cygwin may prefer LF to be used, whereas some simple Windows programs (Notepad, last I looked) and DOS commands don't like any form of line ending but CRLF.
Is there a way of changing what Subversion regards as "native" line ending ? I'm not aware of one, short of recompiling svn.
What line endings do our other windows devs want?
It looks like our choices are:
- Change svn:eol-style to LF. Possible disadvantage is that it might scare off potential new windows devs.
- Change to unset. Though this has the same disadvantage of the above while adding its own problems. Its only advantage is predictability / understandability.
- Somehow get subversion to be user-configurable to change what native means.
There's also an issue of what we do for newly-added files. Subversion currently has no way of saying "all .cpp/.h files added to this directory should have svn:eol-style set to foo". The closest that subversion provides is that we could get is to ask all inkscape users to configure their own copy of subversion to enable auto-props, and ask svn to make all .cpp/.h files added to *any* project (not just inkscape) to have svn:eol-style set a certain way. But I suspect that that isn't the right thing (especially if we decide we want it set to LF while some other project wants native or whatever).
So I think the best we can do is ask people to set the property themselves when they add new files. We could organize for e-mail to be sent automatically.
pjrm.
On Tue, Apr 01, 2008 at 12:05:06PM +1100, Peter Moulder wrote:
What line endings do our other windows devs want?
If I do some bits in Windows (which I occasionally do when don't have my Linux machine at hand) I would usually use some IDE (Eclipse, M$) and both handle LF very well and I dare say there are enough good tools to edit source code in Win to handle LF well that it should not be an issue.
I think the key aspect is consistency and so long as we have all files with LF then we should be OK in any env.
While on the issue, did anyone consider using tools like astyle on check-ins to keep the formating more consistent.
I have worked on projects where every developer had their own formatting preferences and settings but all the codebase in source control was in one common standard and this was achieved by on-the-fly transformations.
Regards, -- Marcin Floryan http://marcin.floryan.pl/ [GPG Key ID: 0D5581C5]
On Apr 1, 2008, at 1:51 AM, Marcin Floryan wrote:
If I do some bits in Windows (which I occasionally do when don't have my Linux machine at hand) I would usually use some IDE (Eclipse, M$) and both handle LF very well and I dare say there are enough good tools to edit source code in Win to handle LF well that it should not be an issue.
Actually... M$'s tools don't really handle LF endings well.
It opens them fine, but tends to add CR-LF endings at odd spots, and it is not uncommon to end up with files with mixed line endings. I've seen this time and again.
On Tue, Apr 01, 2008 at 09:35:33AM -0700, Jon A. Cruz wrote:
If I do some bits in Windows (which I occasionally do when don't have my Linux machine at hand) I would usually use some IDE (Eclipse, M$) and both handle LF very well and I dare say there are enough good tools to edit source code in Win to handle LF well that it should not be an issue.
Actually... M$'s tools don't really handle LF endings well.
It opens them fine, but tends to add CR-LF endings at odd spots, and it is not uncommon to end up with files with mixed line endings. I've seen this time and again.
Well, I am not surprised then. Seems like I've been lucky enough not to have come across this problem before, but then again it was not often that I did *ux development on Win. Still I am pretty sure that VS05 and VS08 now support LF /even if in a somewhat buggy way ;-) /
Regards,
-- Marcin Floryan http://marcin.floryan.pl/ [GPG Key ID: 0D5581C5]
On Tue, Apr 01, 2008 at 12:05:06PM +1100, I wrote:
[If windows developers want to have LF line endings rather than CRLF, then] It looks like our choices are:
Change svn:eol-style to LF. Possible disadvantage is that it might scare off potential new windows devs.
Change to unset. Though this has the same disadvantage of the above while adding its own problems. Its only advantage is predictability / understandability.
Somehow get subversion to be user-configurable to change what native means.
I've just had a look at subversion source. As I feared, there is no user configuration item for what "native" should mean, unless one counts changing the source code as means of configuration.
For people who want LF generally as newline marker (e.g. in the header lines for svn diff output, in various text files created under .svn, template hook scripts etc.), the best way of changing this is to change the definition of APR_EOL_STR in /usr/include/apr-1.0/apr.h (or wherever that file is under MS Windows).
Note that changing APR_EOL_STR [or changing uses of APR_EOL_STR in subversion source] is the *only* way to change what svn uses for default hook scripts etc.
What do windows people think about how to proceed on this?
pjrm.
participants (5)
-
Aaron Spike
-
Bob Jamison
-
Jon A. Cruz
-
Marcin Floryan
-
Peter Moulder