Skip to content

Commit

Permalink
doc: document the "path" field for trees
Browse files Browse the repository at this point in the history
Add a Trees section to the documentation where we can explain
that the "path" field is optional and can be used to place
trees in a custom directory on disk.

Closes: !15
Reported-by: @eyecreate on gitlab
  • Loading branch information
davvid committed Nov 12, 2023
1 parent d16c9e0 commit 2ff5244
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion doc/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,49 @@ Gardens can also include environment, gitconfig, and custom group-level
commands in addition to the commands provided by each tree.


## Trees

The `trees` block in a `garden.yaml` Garden file defines the trees that
are available for running commands against.

Trees represent Git worktrees and can be aggregated into groups and gardens.
The `tree` block defines properties about a tree such as its Git URL,
custom variables, environment variables, Git remotes, Git configuration variables,
and custom commands.

```yaml
trees:
git:
description: Fast, scalable, distributed version control
url: git://git.kernel.org/pub/scm/git/git.git
remotes:
gitlab: https://gitlab.com/gitlab-org/git.git
github: https://github.com/git/git.git
gitster: https://github.com/gitster/git.git
commands:
build: make all -j ${num_procs} "$@"
test: make test "$@"
variables:
num_procs: $ nproc 2>/dev/null || sysctl -n hw.activecpu 2>/dev/null || echo 4
path: git
```

All fields are more or less optional. The `path` field defaults to the same
name as the tree, so the `path: git` setting above can be omitted without
any differences in behavior.

The `path` field can be used to name trees on thing while placing them in
a different directory on disk. `path` defaults to the same name as the tree,
for example `git` above.


## Templates

Templates allow sharing of command, variable, gitconfig, and environment
definitions across trees. Adding an entry to the `templates` configuration block
makes a template available when defining trees.

Specify `templates: <template-name>` to inherit the the specified template's
Specify `templates: <template-name>` to inherit the specified template's
settings when defining trees. The `templates` field also accepts a list of
template names.

Expand Down

0 comments on commit 2ff5244

Please sign in to comment.