A modern VCS mistake enabled by working on live trees

October 27, 2010

I've written before about sysadmin style use of version control, where we typically use a VCS for documenting the live tree instead of developing something. Recently I ran into a mistake that modern VCSes and this style of working combine together to enable: deleting a file from the live directory tree but forgetting to delete it from the VCS.

Since the live tree is, well, live, deleting the file actually takes effect and so you don't notice anything wrong. In fact, in a sense nothing is wrong except that your VCS repository no longer accurately reflects the state of the live system.

(If you make a habit of running 'hg status' or the equivalent you may notice the complaints about this, but our working practice is 'hg diff, make changes, hg diff, hg commit', and at least in our current version of Mercurial this produces no complaints; as a result, we sailed along in this situation for some time.)

There's at least two dangers of this situation. The first is that you haven't captured information about when the file was actually deleted from your live system, and you may want it someday (you can sometimes guess based on other changes). The second is that if you ever have to actually check out the tree (in any version, either the current one or an older one), these deleted files will spring back to life. Sometimes this is just surprising and distracting clutter, but it could be a problem if the file is in some place where its mere presence will cause it to be used for something.

(If the removed file has to be mentioned in a configuration file in order to do anything, having it reappear is generally harmless because you will have also committed the change to the configuration file that stops using it.)

There's also the mirror image mistake of adding a file to the live tree without committing it to the VCS repository, but we haven't made that one yet.

Written on 27 October 2010.
« Why Python's struct module isn't great for handling binary protocols
An extra problem with not documenting things in open source modules »

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Wed Oct 27 01:56:47 2010
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.