Directories Jonathan S. Shapiro (shap@eros-os.org)
Wed, 12 Apr 2000 21:13:28 -0400

Okay. This is another issue frought with peril. I think it's the last major one. For a contrary opinion, have a look at the Tigris requirements discussion, which can be found at

http://inversion.tigris.org/source/browse/inversion/notes/

Click on inversion.txt and grab the top version.

The question is: are directories first class?

I claim that generally the answer should be "no". That is, while a file whose name is

foo/bar/blah.c

is implemented using directories in a UNIX namespace, this is an accidental property. For contrast, an object whose name is

foo.bar.blah.c

would NOT imply intervening directories.

In general, then, I claim that directories are an artifact of the user agent, and typically should not be explicitly represented by the configuration management system. Certainly, this assumption is sufficient for working source trees, with two exceptions:

  1. The repository may need to explicitly record directories that are empty "leaf" directories.
  2. For things that are checked out in binary form, there may be ownership and permissions requirements that the repository should capture.

Note, however, that these are compatible. Consider two configurations. The first contains:

foo/bar/blah.c true-name type

The second contains:

foo/bar/blah.c true-name type
foo/bar 0755 shap.shap

When expanding the first configuration, the CM system implicitly creates the directories foo/ and foo/bar/ with permissions appropriate to a source tree. If it later encounters a directory-specific record, it treats this record as definitive and revises permissions and ownership accordingly (permissions allowing). Ownership raises some interesting issues here, as the user probably is not root.

This differs strongly from the view expressed in the tigris design. In general, I see no reason to capture directories as long as paths are fully recorded.

Opinions?

shap