Pet names, true names, and nicknames Jonathan S. Shapiro (
Tue, 11 Apr 2000 22:53:37 -0400

The idea described here is due to Mark Miller and others while at Electric Communities.

To preserve ease of replication, all entities (objects) stored in a DCMS repository have a "true name", which is (currently) a cryptographic hash of their content. At the moment, I am using the SHA-1 hash, because it is slightly better than MD5, but any good cryptographic hash will do.

In my current implementation, the "true name" of an object is the string that results from concatenating

"MXsha-" + modified-base64(sha(<<file content>>))

Where modified-base64() computes the base64 encoding of the sha per the MIME standard, but substituting '$' for '/' in the encoding because '/' is not permitted to appear in file names. [I'm not stuck on using '$' if there is a better choice.]

The problem with true names is that they are exceedingly difficult to type. As humans, we want to refer to (e.g.) projects with familiar human names. The catch is that human names are not unique. It is quite likely that at some point some other person will start a project under the name EROS, and we would like this not to lead to ambiguity. Therefore, true names, pet names, and nicknames.

nickname: In addition to its true name, every project has a nickname. This is a human-readable name assigned to the project by its creator.

When a project is first installed in a particular repository, a pet name for the project is generated as follows:

  1. Try the nickname. If this is not already taken, stop.
  2. Generate a new name which is some transform on the nickname, such as nickname.1, nickname.2, etc.

The pet name can be changed by suitably authorized users of a particular repository, but must be unique w.r.t. that repository. As a result, the result of concatenating:

repository-URL + repository-pet-name

is a unique, human readable name for a project. You can send me this URL, and I can replicate the project to my machine. Note that because of the pet name construction rule I will initially get a publicly common name for the project as opposed to your choice of wonky pet name. I can always change to your wonky name if I like it.

However, pet names are purely locally scoped. I was headed this way, but the pet name/nickname notion makes it usable, for which great thanks to MarkM et al.