views:

164

answers:

5

Recently I've been revisiting an old project, which I last worked on about two years ago. Obviously, during this time I've learned new habits about how best to program, and I've got the itch to keep the tests, scrap the implementation, and re-implement the entire project. It's not a large project, and I believe I'll not be losing much by re-writing it.

However, I don't know what to do about the version history. It's likely that when I'm done updating it, the new version will share only 3-4% of its code with the old version. Furthermore, the changes tend to be so wide-reaching that trying to maintain clean changesets is an exercise in frustration and futility. Given this, it seems unnecessary to force potential developers to download the old irrelevant versions.

One option I've been considering is to move the trunk to a branch, something like old-trunk/, and begin development in an empty branch. I don't know if this is a good idea, and I'm concerned that having two trunks could lead to confusion. Which brings me to the question:

What does SO think? If you encountered a project that had "reset" its trunk, would you be confused by it?

+4  A: 

Why not just label/tag the trunk with "OldVersion" and continue development in the same location? This way you avoid the double branch altogether and still maintain ways to get to the old version of your code. Unless you're developing a different product, you likely want to keep the same trunk.

JaredPar
As mentioned, there will be very little code shared between the "old" and "new" trunks. However, the old irrelevant versions would still appear in version lists, project summaries, etc.
John Millikin
@John, IMHO, maintaining history is a good thing. When you hit those random pieces of code during the translation, it's good to have a history in order to put the code in context. The versions are not irrelevant because they're part of the process which lead to the current version of the code.
JaredPar
I've decided to just stick with the single trunk. I'll remove the old code, commit, and then begin work on the new.
John Millikin
A: 

I tag the $trunk, so there is a "copy". Tag it the last version released, or the date before you started back on it, etc. I actually tag on the date released, and name my tags the actual date itself. (use Label inplace of tag if that is what your system supports).

After it is tagged, delete/rename/overhaul as needed. The version history is there, just in case. And, you have a complete copy labelled/tagged for archiving purposes.

eduncan911
A: 

Assuming you're using SVN, there's really nothing extra to do. Just remember the revision from which you started refactoring and then continue in working on the trunk. It's better than moving to an empty branch since the history of the changes from the old code to a new one will be recorded.

However, if you plan to write the thing from scratch and just copy some little bits of old code, maybe you should think about starting it in a new repository.

Igor Brejc
There's not any significant history between the old and new version, excepting "rm -rf *". Perhaps the READMEs and makefile would remain relatively intact, but little else.
John Millikin
Then I guess a new repository would be the best option. After all, it's a completely new project.
Igor Brejc
A: 

I don't see the need to throw the old version away. Just make all changes and check in. New developers will not have to download any old code, they will always just check out the new version.

A: 

No, it wouldn't confuse me because the project documentation would show that before I even got into it. We ALL have crap that needs to be redone, and frankly, should be.

Tell everyone it's insecure and not HIPAA compliant and they'll let you re-code it ;o) And then start posting the fodder onto The Daily WTF for the rest of us 80))

Keng
This is a personal project, so I don't need to worry about requesting permission. I doubt the code would be suitable for the DWTF -- it's not particularly bad code, just significantly overcomplicated for what it does (I'd never heard of YAGNI when writing it).
John Millikin
If the code is that different, why not a whole new project?
Keng
I think the name's clever :)
John Millikin