Inconsistent Line Endings

If you’re using Subversion and you get a problem between two branches with “inconsistent line endings” you may be in for a world of hurt.

Subversion has to be explicitly told, file-by-file, to handle cross-platform variations in newline representation through the “svn:eol-style” property being set to “native” (or a specific line ending).

Unfortunately, if you change this attribute in two branches independently you won’t be able to merge them as-is. Fix: “svn propdel svn:eol-style” all the files in the merge-destination, then merge.

But if you haven’t set this property on one or more files and someone goes and edits them on a different system… Lets say “main.cpp” was checked in from a Windows box and someone edits it on a Mac in XCode or a Linux box in Emacs or Vi… Somewhere in the process those modified lines get Mac/Linux line endings – which is inconsistent with the rest of the lines.

Work around?

If you discover this in your baseline after you have made an active branch: Reformat the drives, all of them, take the disks out and defecate on them, then throw them away. I mean, forget about it. Subversion is going to make you beg and plead to be allowed to go back to suffering Visual SourceSafe or Perforce. Just pack up and call it quits.

I mean, you might think that you could just rebranch the baseline and manually make the changes in the branch again? Yeah, that’s because you just don’t appreciate the exquisite pleasures of having a piece of source control software control your gonads with electrodes.

I may be exagerating a little here, but for over a week now we have been bleeding away time trying to fix this damn problem. Any time switching to subversion might have benefited us is spent twice over just trying to correct a stupid little mistake. Yeah, we could just have ditched 5 weeks of edit history during a really busy 5 weeks. That’d be valuable.

In the end it seems like we may finally have managed to solve it by rebranching and having Martini re-implement his changes to the branch and check them in one file at a time, but it still periodically springs an “inconsistent line endings” on him and we really can’t figure out why now. The files are dos format, he’s editing them in visual studio. I even had him resort to running the Command Prompt for the first time ever on his box and manually performing the svn operations.

And as he started checking in his little safety commits, we were both enviously eyeing the Visual SourceSafe window on his other box…

7 Comments

See, this is what happens when you get all upity. Are you too good for CVS or something? Are you?

Actually, doesn’t gvim use the same line endings across systems? Why would you be using any other editor? Are you upity and philistines?

And before I committed to any long term work I’d check stackoverflow.com. Someone has run into this before.

Path of least resistance, Subversion has integration potential with more of the tools/utilities we currently use and/or are looking to use.

Although because the Unix and Mac file systems are actually secure, the chances of something going to the effort to create something truly comparable to TortoiseCVS/SVN is pretty low. (Tortoise uses an ability to intercept certain mid-level operating system calls and lie to them about what is actually on the disk).

Otherwise I’d have been more than happy to move to CVS.

Notice to All Employees

As of November 5, 2008, when President Obama is officially elected into office, our company will instill a few new policies which are in keeping with his new, inspiring issues of change and fairness:

1. All salespeople will be pooling their sales and bonuses into a common pool that will be divided equally between all of you. This will serve to give those of you who are underachieving a “fair shake.”
2. All low level workers will be pooling their wages, including overtime, into a common pool, dividing it equally amongst yourselves. This will help those who are “too busy for overtime” to reap the rewards from those who have more spare time and can work extra hours.
3. All top management will now be referred to as “the government.” We will not participate in this “pooling” experience because the law doesn’t apply to us.
4. The “government” will give eloquent speeches to all employees every week, encouraging it’s workers to continue to work hard “for the good of all.”
5. The employees will be thrilled with these new policies because it’s “good to spread the wealth.” Those of you who have underachieved will finally get an opportunity; those of you who have worked hard and had success will feel more “patriotic.”
6. The last few people who were hired should clean out their desks. Don’t feel bad, though, because President Obama will give you free healthcare, free handouts, free oil for heating your home, free foodstamps, and he’ll let you stay in your home for as long as you want even if you can’t pay your mortgage. If you appeal directly to our democratic congress, you might even get a free flatscreen TV and a coupon for free haircuts (shouldn’t all Americans be entitled to nice looking hair?) !!!

If for any reason you are not happy with the new policies, you may want to rethink your vote on November 4th…

Geez reb, do you really think your vote will change anything?

Dream on.

Poor ole Reb seems a tad undone. He’s mistaken Oli’s site for OT.

And here I thought I was old ;)

Seriously, Reb? Spewing politics on kfs1’s coding-oriented blog? That’s epic fail, right there.

haha it was a slip of the cut n paste hand sorry bout that dont BAN MEH!@!!!

lol

i thought it was funny is all and no my vote dont mean crap but im gonna vote just so i can feel better than if i dont and that liberal SOB gets elected at least i can say i did my part to keep him out

again sorry for the hijack :(

Leave a Reply

Name and email address are required. Your email address will not be published.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

You may use these HTML tags and attributes:

<a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <pre> <q cite=""> <s> <strike> <strong> 

%d bloggers like this: