markemptydirs


Manages placeholder files necessary to version control empty directories

Table of Contents


News

Introduction

CVS, Mercurial, GIT as well as other well-known version control systems cannot version directories. In other words, you cannot add empty directories! A "workaround" for this issue is to use placeholder files which are placed into empty directories. These placeholder files can then be committed into the repository and will make sure that, upon checkout, the directory tree is entirely reconstructed. This solution is also suggested in the Mercurial FAQ, or in the GIT FAQ, for instance. Note however, that using that workaround might not be a good idea. Creating missing directories during a build process should also be considered as an option.

Sometimes a solution where the missing directories are created by some magic is not practicable and people will face the problem of managing such placeholder files. In particular, the problem with using placeholder files is that you need to create them, and delete them, if they are not necessary anymore (because there were added sub-directories or files). With big source trees managing these placeholder files can be cumbersome and error prone.

In the past, I had been confronted with such a situation several times. This is why I decided to write an open source tool which can manage the creation/deletion of such placeholder files automatically. It creates placeholder files in all empty "leaf" directories. If later on new files or directories are put into such directories, the placeholder files are not necessary anymore and, thus, are removed automatically.

http://markemptydirs.googlecode.com/files/Screenshot.png

Licensing

This tool is licensed under the GPLv3.

Operating Systems

MarkEmptyDirs is written in C# and is designed to be platform independent. Currently, it runs on Mono.NET as well as on Microsoft.NET platform. The following compatibility matrix shows the currently supported operating systems and runtimes.

| Operating System | Supported Runtimes | |:---------------------|:-----------------------| | Linux | Mono.NET | | MacOS X | Mono.NET | | Windows | Mono.NET, Microsoft.NET |

Further Reading

  • GettingStarted describes what you need to do in order to run MarkEmptyDirs.
  • UseCases describes typical use cases for this tool and how to use it.
  • ChangeLog describes what has changed in the different releases.

Final Notes

If you like MarkEmptyDirs please digg it, because seeing there is some interest in this tool motivates me to develop it and improve it further :)

Someone else seems to have had the same problem with empty directories. He also wrote a similiar program which you can find here.

Project Information

Labels:
mercurial cvs tool perforce vcs dvcs mono .net git windows linux macosx