Should old/legacy/unused code be deleted from source control repository?

Posted by Checkers on Stack Overflow See other posts from Stack Overflow or by Checkers
Published on 2010-05-12T01:51:03Z Indexed on 2010/05/12 1:54 UTC
Read the original article Hit count: 228

I've encountered this in multiple projects. As the code base evolves, some libraries, applications, and components get abandoned and/or deprecated.

  1. Most people prefer to keep them in. The usual argument is that the code does not really take any space, it can be left alone until needed again. So a repository slowly turns into a cesspool of legacy code, where it's hard to find anything.
  2. Some people delete old code, since it creates clutter, raises more questions for new people, and you can restore any old snapshot of the code base anyway. However you can't always find the old code if you don't know where to look, as none of the (common) VCS I know offer search over the entire repository including all historical revisions, and the only way to search the old files is to check out the revision where the deleted file exists.

What would be a good approach to repository management?

© Stack Overflow or respective owner

Related posts about vcs

Related posts about version-control