views:

65

answers:

2

I have some old code (an old but still maintained VB6 application) that from a source control point of view is the ultimate example of the plumber's plumbing (or cobbler's shoes). It's been version controlled by the approach of making a new directory for each version.

Are there any major downsides to taking the following approach?

  1. Do the initial check-in of all files
  2. Erase all files from the working directory, then copy all files from the next version to the working directory
  3. Check them in
  4. Goto #2 until done

Note that I have a general change log text file which I'd grab the comments from for each version I check in/commit. I don't have (or really care about at this point) comments on a per-file- basis.

I don't really know at this point what files have changed between versions, and being lazy I figured I could avoid doing file compares between versions to find out, so that's why I'm taking the approach above. Not to mention that erasing all the files first allows file deletions to be detected.

I specifically haven't mentioned which version control tool I'm using since I'm hoping (also assuming, but maybe very incorrectly) that the answer is fairly independent. When I use terms like "check-in" I use them in the general sense, not specific to a tool.

+1  A: 

That's a reasonable approach. Some source control systems (TFS, for example) will silently ignore attempts to check in a file that is unchanged. This is a good thing. If yours doesn't have this feature, I recommend doing a diff across all files and only checking in the changed ones. Otherwise, you add a great deal of noise to the file histories.

Steven Sudit
Also don't forget that you'll have to manually reconcile files that are added, removed and renamed between versions (again, depending on your SCM software)...
Dean Harding
@codeka - Good point, I'd forgotten about this... Given this, I'm not sure I can avoid the process of explicitly finding out my adds and removes between versions (however I choose to do it). Agree?
Emilio
But at least you only have to do it on a file-by-file basis, rather than having to actually look inside files for diffs. Also, if you use something like TortoiseSVN, it'll make it easy to spot files that have been added (though you won't know about files that have been deleted).
Dean Harding
@codeka - I am indeed using Tortoise. The cat's out of the bag now, it's SVN. :)
Emilio
You could also diff the list of files in each version to solve the added-removed problem. You could automate this whole process quite easily.
mfperzel
@thec: Good point. In fact, I wouldn't be surprised if that functionality was available in some open-source SVN extension project or something along those lines.
Steven Sudit
For the record, this was downvoted arbitrarily by someone who is unhappy with me.
Steven Sudit
+1  A: 

Is there value in the changes made to previous versions?

If this is more or less ironed out code and it's not part of a release history of products that are in maintenance, there might be little value in maintaining the history. Zip up the directories somewhere (just in case) and place the most recent version in source control. There may be no real need to do a bunch of work to create a history that has little or no value.

As an example, when moving to a new revision control system many organizations might just start the new system with the head of the existing system (or maybe a set of branches) and have to go back to the legacy system for any history beyond the switchover date.

Michael Burr
@Michael - The value of the history is admittedly low, but maintaining it satisfies my need for some minimal degree of order. If this was a work project vs a personal one and the value of the history was low, I wouldn't do.
Emilio
@Emil: He's right that not every version is essential. The released versions are, but the rest are optional.
Steven Sudit
@Emilio: of course only you can can determine the value of the history - I was just suggesting that it be taken into consideration because I think in a lot of cases someone might just have a quick reaction that you've gotta put the history in there since it's available in some form. Also, don't forget if you have an archive of the original directories you have a history, just one that's painful to access. But if you only need to access it once in a blue moon, that might be OK.
Michael Burr
@Michael - good points all, agree.
Emilio