OCD Dev Log #000

Organize current dotfiles

OCD Dev Log #000

20 April 2025

by Jason Pena

NOTE: This entry was digitised from my personal bullet journal. Thus, a lot of textual clean up was done to make my thoughts more coherent compared to my notebook.

The Concept of a Cluster

OCD operats on a cluster. A cluster is a collection of repositories that can be deployed together. A cluster is comprised of two major components: the cluster definition, and the repository store. The cluster definition is a special configuration file that defines the entries of a cluster that OCD needs to manage. The repository store houses the actual repositories defined as entries to a cluster from the cluster definition. The cluster definition is located at $XDG_CONFIG_HOME/ocd/cluster.toml, while the repository store is at $XDG_DATA_HOME/ocd.

The cluster definition contains two entry types: root and nodes. A root houses the cluster itself, and nodes are various external repositories to deploy. A given entry type can be defined as one of two kinds: normal or bare-alias. A normal entry represents a normal Git repository whose gitdir and workdir point to the same path. A bare-alias, entry is a bare repository that uses a directory as an alias for a worktree. The root itself is a bare-alias repository that contains the cluster definition itself. There can only be one root, and it must always be deployed, Nodes can be normal or bare-alias.

The repository store follows the same structure as the cluster definition. There is only one root repository named “root” that is always deployed. There a set of node repositories named by whatever name given in the cluster definition.

NOTE: OCD generally follows the XDG Base Directory standard for the placement of configuration data. Although, the code base uses the dirs crate, which allows OCD to follow Known Folder (Windows) and Standard Directories (MacOS).