Skip to content

Change how detached ("ephemeral") roots work #857

Description

@lumi-me-not

Currently, when moss --directory $ROOT sync --to $TARGET is run, in the blitting phase it will rm -rf $TARGET and then blit into $TARGET/usr. .moss is located in $ROOT/.moss in this case.

I suggest instead of --to and --directory, we use --moss-dir and slightly change how --directory works:

  • --directory $ROOT will be the target that is blitted to, where triggers run, etc
  • --moss-dir $MOSS_DIR will be the .moss directory

By default, --directory $ROOT will implicitly set --moss-dir $ROOT/.moss, so that behavior stays the same. If the moss directory is not on the same filesystem as the root, then this should emit a warning, as doing that is very inefficient.

What's nice with this terminology is that it mirrors GIT_DIR and GIT_WORK_TREE: GIT_DIR is the same as --moss-dir and GIT_WORK_TREE is the same as --directory.

I think it would be good to also rename ephemeral roots to detached roots, or something similar.

For aerbox I want to have the moss dir be in $XDG_DATA_HOME/aerbox/moss, and this is currently not possible, as it's not possible to set the location of .moss directly. Best I can do here is $XDG_DATA_HOME/aerbox/moss/.moss.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions