line endings in svn - General Discussion and Assistance - CHDK Forum supplierdeeply

line endings in svn

  • 29 Replies
  • 19375 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
line endings in svn
« on: 14 / August / 2008, 17:08:22 »
Advertisements
Quote
beware of line endings too, the tree seems to be randomly mixed dos and unix and no eol-style:native set in svn.

perhaps someone can name those files that are not according to the rest of the standard, so i can fix that in both trunk and branch. i dont know if setting this eol-style is allowed. so i guess just fixing the files would solve this. (I'm on windows box, dont know how to do it, finding out the files i mean)

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
line endings in svn
« Reply #1 on: 14 / August / 2008, 17:33:48 »
@PhyrePhox

I would do this in Windows with Notepad++
Set 'Show All Characters' to get a good view of CR and LFs
Then use Format->Convert to Windows or Convert to Linux to convert
I'll have a shot at it tomorrow & try and get you a list

wim
« Last Edit: 14 / August / 2008, 17:41:12 by whim »

*

Offline reyalp

  • ******
  • 14077
line endings in svn
« Reply #2 on: 14 / August / 2008, 17:38:26 »
OT, but File Portability

This is preferable to just trying to "fix" the tree, since people with different editors on different platforms will probably change them again.

If you set it on an existing tree with mixed line endings, it seems to do the right thing. Of course, you might want to check with the other users before you go and do anything like that :)

If you decide you want to, the easiest way to do it is probably use find + command line svn to set it on every .c, .h, .S and makefile (edit: including the various .inc).

edit: you may want to check first to make sure all the tools actually work with windows endings. It's possible that things like gmake will barf on crlf, even on windows. In that case, those should be set to the desired format, not "native"

I use gvim on windows, which lets you change  pick whatever format you want, and doesn't automatically change endings.
« Last Edit: 14 / August / 2008, 17:41:00 by reyalp »
Don't forget what the H stands for.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: line endings in svn
« Reply #3 on: 15 / August / 2008, 20:15:35 »
roughly less than a third of all files in the svn use windows line endings, the rest uses linux line endings.
so i guess setting the svn property to "native" (for the dev stuff) and to CRLF (for the documents and readmes) is the best option. will do some tests.
thing is: setting all files to native would result in windows users looking puzzled onto the linux-autobuild generated docs in the zipfile - so these should remain CRLF (also i doubt there will be lotsa diffs floating around here dealing with these). so, when someone on a linux box generates a diff that a windows user wants to apply this shouldnt be that big of a problem, afaik tortoise can handle that - the problem was (and is right now) the MIX of different line endings throughout the whole svn repo.


*

Offline reyalp

  • ******
  • 14077
Re: line endings in svn
« Reply #4 on: 15 / August / 2008, 21:27:50 »
It's not a big problem. Maybe not a problem at all if none of the developers are bothered by it. It just potentially adds noise to diffs or makes it harder for people to apply patches.
Don't forget what the H stands for.

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: line endings in svn
« Reply #5 on: 16 / August / 2008, 03:57:51 »
@PhyrePhox

Can't you 'just' integrate a dos2linux pass on appropiate dirs in the root Makefile ?

wim

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: line endings in svn
« Reply #6 on: 16 / August / 2008, 10:57:42 »
It's not a big problem. Maybe not a problem at all if none of the developers are bothered by it. It just potentially adds noise to diffs or makes it harder for people to apply patches.

well, i know i had a lot of problems applying diffs back in the days when i worked together with jucifer without svn access. he on windows, me on linux. if we can reduce these problems: why not. how would you apply the svn properties recursively using find?

whim: i dont think that it'll work, besides you would increase build-time significantly, or i just didnt understand you correctly :D

*

Offline reyalp

  • ******
  • 14077
Re: line endings in svn
« Reply #7 on: 16 / August / 2008, 16:37:47 »

whim: i dont think that it'll work, besides you would increase build-time significantly, or i just didnt understand you correctly :D
You could also use svn export to extract the distribution media (readme's etc). You can force whichever EOL style you want, and if you use the working copy form, it should be quite quick.
Don't forget what the H stands for.


*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: line endings in svn
« Reply #8 on: 18 / August / 2008, 15:17:15 »
I would suggest take latest svn export, apply linux linebreak with dos2unix for all files (besides readme.*, keep it readable for regular windows user) and commit changes back. Let's start with trunk, test it and than change braches too.
This will cause some pain, but developer could apply same linebreak to there local syn export to reduce different to there source before  compare or committing...

Also it maybe a good idea to apply tidy to get a clean structur.... This require to custom tidy to our needs...
This may cause additional pain... but some glitches made by tidy are easier to correct than the hole source...

Project leader should make a decision about what linebreak and code layout should be used and than apply these changes to source once.
I think, this is afford would be very usefull. Devs should not wait, otherwise this will get worse as chdk source expands!


Every Windows dev should have a good texteditor like pspad, ultraedit, notepad+ or else installed anyway, so theres no problem using linux linebreak on windows. Don't be lazy ;).

Maybe i'm wrong... just my 2 cent.

Re: line endings in svn
« Reply #9 on: 19 / August / 2008, 23:33:19 »
Its not just the line endings.
Take a look at the tabs/indents. Its all hosed up as well.
Some of the modules are really tough to read.
There are different tab widths, indention widths, and some folks use spaces with no tabs at all.
(I've struggled/fought with this issue on projects many times over the past 20+ years)
I think much of this caused by most people assuming or wanting to force shift/indention widths to be equal to their tab width.
Over the years I see so many people change their tab settings in order to change the look of their indentations.
This is a horrible practice.
The proper way is to set the indention/shift width separately from the tab width.
Decent editors will allow this.
Some folks think that they avoid the problem by not using tabs. But in fact they ruin the formating
as well because they align what they see on the screen to the tabs indention width set up in their editor.
If their tabwidth was set differently from the one assumed by the file, their new text will not line up
with the existing text that used hard tabs.

To me, hard tabs are 8. Period! Indents can be anything you want.
Even though I abhor the practice of changing the tab width to something
other than 8, at a minimum I'd like to see the tab width locked down to 1 value
or at least use the vi modelines to set the tab widths automatically.


Those that checkin files with screwy misaligned indents, should be spanked 3 times with a wet noodle. :haha

Just my 0.02

--- bill

« Last Edit: 19 / August / 2008, 23:36:47 by bperrybap »

 

Related Topics