Skip to main content

Crate ocd

Crate ocd 

Source
Expand description

Internal library for OCD tool.

OCD stands for “Organize Current Dotfiles”. It is a tool that provides a way to manage dotfiles using a cluster of normal and bare-alias Git repositories. A bare-alias repository is a special type of Git repository that allows a target directory to be used as an alias for a worktree. This enables the target directory to be treated like a Git repository without the need for initialization.

This approach facilitates the organization of configuration files across multiple Git repositories without the necessity of copying, moving, or creating symlinks for the files. It allows for a more modular method of managing dotfiles.

See the CONTRIBUTING.md file about contribution to the OCD coding project if you have any ideas or code to improve the project as a whole!

§The Concept of a Cluster

A cluster is a group of repositories that can be deployed together. It is comprised of two major components: the cluster definition and the repository store. The cluster definition defines all entries of a cluster within a special configuration file. The repository store houses all repositories defined as entries in the cluster definition.

The cluster definition contains two entry types: root and node(s). A given node entry type can either be normal or bare-alias. All node entries can be deployed, undeployed, added, and removed at any time from the cluster definition. The root is a special bare-alias entry that hosues the cluster definition itself. There can only be one root, and it must always be deployed such that it can never be undeployed. Removal of root will cause the entire cluster to be removed along with it, included all defined node entries.

The repository store follows the same structure as the cluster definition. There exists a root repository, and a set of node repositories within the repository store. The root repository is simply named “root” at all times, and the node repositories are named whatever name they were given in the cluster definition. The repository store always reflects the changes made to the cluster definition such that a top-down heirarchy is followed, with the cluster definition at the top and repository store at the bottom.

Modules§

cmd
Command set implementation.
model
Configuration model.
store
Repository store management.