Changelog
v1.9.0
Released 2024-10-11
Features:
garden exec
can now run commands in parallel using the-j# | --jobs=#
option. (#43)
Packaging:
Development:
-
Internal APIs for running commands were refactored.
-
The
yaml-rust2
dependency was upgraded to v0.9.0.
v1.8.0
Released 2024-09-26
Features:
-
garden cmd
and custom commands now have a-j# | --jobs=#
option for running commands in parallel. Use-j0 | --jobs=0
to use all available cores. (#43) (#45) -
garden ls
now has a--reverse | -r
option to display trees in reverse order. (#44)
Development:
- The
which
,yansi
andstrum
dependencies were upgraded.yansi
was a new major version and required a fair amount of changes.strum
involved minor changes. (#42)
v1.7.0
Released 2024-06-29
Features:
-
garden ls
now has a--commands | -c
option to display just commands. The related--no-commands | -C
option is used to omit commands from being displayed. (#39) (#41) -
garden cmd
andgarden <custom-command>
now support a--dry-run | -N
option to perform trial runs without actually running any commands. (#39) (#41) -
garden exec
made-N
the short option for its--dry-run
option and the original-n
short option was made an undocumented alias for compatibility. (#41) -
The
garden eval
,garden exec
,garden cmd
and custom sub-commands now accept the same--define | -D name=value
override options as the rootgarden
command. -
garden grow
reports more details about the commands it runs and no longer prints redundantgit config
commands.
Fixes:
garden ls
now prints the list of commands in the same order as they appear ingarden.yaml
. (#39) (#41)
Packaging:
-
The nix flake was updated to re-enable llvm coverage. (#38)
-
nix run
can now be used to rungarden
andnix shell
can now be used to open a nix shell with garden installed. (#40)
Development:
-
More structs, functions and methods were made private.
-
Several types were renamed from "HashMap" to "Map".
v1.6.0
Released 2024-06-02
Features:
-
zsh
is now invoked usingzsh +o nomatch
for better portability across shells. This prevents zsh from erroring when wildcard patterns find no matches. Wildcards can be used, for example, to implement a customclean
command that feedsrm -f
using wildcard patterns, but these commands would generate errors without disablingnomatch
. The zshnomatch
option is a less useful option for non-interactive use so we disable it unconditionally. -
The
--verbose | -v
option can now be passed to custom and built-in commands. Theverbose
option was previously a global option that had to be specified before sub-commands. The following invocations are all equivalent now:garden -vv build
garden -v build -v
garden build -vv
(#36)
Packaging:
- The nix flake was updated to use Fenix for the latest stable rustc 1.78.0. (#37)
Development:
- An
.envrc
file was added to enable the nix flake for direnv users. (#37)
v1.5.0
Released 2024-04-14
Features:
-
Running
garden init
inside a Git repository will now record the current directory as a tree with its path set to${GARDEN_CONFIG_DIR}
. (#34) -
Custom commands skip missing trees by default. A new
-f | --force
option can be used to makegarden
run commands on missing trees. (#33) -
garden plant
now avoids updating the configuration when a tree is re-planted and its configuration contains expressions that evaluate to the same value as currently exist in git. (#31) (#32)
Packaging:
- Prebuilt binaries are now available!
Development:
-
The original github repository under
davvid
's namespace was transferred to the garden-rs organization on github. -
The
yaml-rust2
dependency was upgraded to0.8.0
to avoid theencoding
crate (RUSTSEC-2021-0153).
v1.4.1
Released 2024-03-22
Features:
- The empty directory detection in
garden grow
was improved.
Development:
- The internal APIs were updated to use
AsRef<Path>
wherever possible.
v1.4.0
Released 2024-03-21
Features:
-
Custom commands can now specify an interpreter to use on a per-command basis. If a command uses a shebang
#!
line then the command's text will be passed as the next argument to the specified command. For example, using#!python3 -c
as the first line in a custom command will causepython3 -c <command>
to be executed. -
Trees can now use branches defined in separate remotes when configuring the default branch to checkout.
garden grow
will now fetch the remote associated with the configured branch switching branches in order to make this possible. -
Trees can now use any upstream branch from any configured remote in the
branches
section. Previously, branches associated with non-default remotes could not be created unless they were fetched beforehand.garden grow
will now fetch the associated remote before creating the local branch. -
garden grow
now detects empty directories (e.g. the directories that are created when using uninitialized Git submodules) and will properly clone into the empty directories instead of treating them like an already-grown tree. (#30)
Development:
-
garden
can now be built on Windows. Symlink trees and the XDG base directory support is UNIX-only and disabled on Windows. (#17) -
yaml-rust2 is now used instead of the yaml-rust-davvid fork that was being maintained by @davvid for use by garden. (#29)
v1.3.0
Released 2024-02-19
Features:
-
garden eval
and garden expressions in general will now resolve variables defined withinenvironment
blocks. Environment blocks were previously not considered when resolving variables. Environment blocks are now resolved and checked for variables when${variable}
expressions do not find the variable in scopes with higher precedence. The precedence order, from strongest to weakest, is thevariables
block in a garden's scope, thevariables
block in a tree's scope, thevariables
block in global configuration scope, theenvironments
block in a garden's scope, theenvironments
block in a tree's scope, theenvironments
block in global configuration scope and, lastly, OS environment variables. The first entry found is used when expanding variable expressions. (#23) -
Evaluation cycles (i.e. circular variable dependencies) are now prevented when evaluating garden variables. The evaluation engine will now return empty strings when a variable with a cyclical expression is evaluated. (#24)
-
When
zsh
is used as thegarden.shell
, which happens automatically whenzsh
is installed,garden
will now usezsh -o shwordsplit
in order to enable word-splitting of$variable
expressions by default. This makeszsh
behave just like other shells by default, which improves the portability of commands. Configuregarden.shell-wordsplit
tofalse
or use thegarden <cmd> -z | --no-wordsplit
option to opt-out of this behavior. (#25) -
garden.shell
can now be configured to use arbitrary commands for executing command strings. Garden uses the configuredgarden.shell
as-is and does not augment its options (e.g.-e
or-o shwordsplit
) when a custom command is used. Custom commands are identified as commands that expand to 2 or more command-line arguments. Thus,python3
is not considered a custom command andgarden
will runpython3 -c <string>
to run commands. On the other hand, specifyingruby -e
is considered a custom command because it expands to["ruby", "-e"]
under the hood. If you need to use a custom command that takes no additional command-line arguments then you can useenv
as an extra argument to have it be considered as a custom shell. For example,env custom-shell
will causegarden
to runenv custom-shell <string>
, which is equivalent tocustom-shell <string>
. Using justcustom-shell
would have resulted ingarden
runningcustom-shell -c <string>
instead, which may not be desired. (#26) -
The
garden shell
command can now be configured to use an interactive command shell that is distinct from the command specified in thegarden.shell
configuration by configuring thegarden.interactive-shell
value. (#26) -
garden shell
can now be run without any arguments. The tree query now defaults to.
so that the tree in the current directory is used when nothing is specified. (#26) -
Custom commands now have access to a
${GARDEN_CMD_VERBOSE}
and${GARDEN_CMD_QUIET}
variables which can be used to forward the--verbose
and--quiet
arguments down into childgarden
invocations.${GARDEN_CMD_VERBOSE}
uses the short-v
flag in the value to support the case where the verbose option is specified multiples times to increase the verbosity level (e.g.-vv
). (#27)
v1.2.1
Released 2024-02-05
Development:
-
The
yaml-rust-davvid
dependency was upgraded tov0.6.0
. -
Documentation and code maintenance.
v1.2.0
Released 2024-01-27
Features:
-
If a garden file has no trees defined at all then an implicit tree called
.
will now be synthesized into existence. The presence of this implicit tree allows garden files that define just the current directory as a tree to omit the entiretrees
section altogether. This consequently makes it easier to use garden as a simple command runner because thecommands
section is the only section required in order to rungarden
commands. -
When
garden.root
is not configuredgarden
will behave as ifgarden.root
is configured to${GARDEN_CONFIG_DIR}
. This allows garden files to omitgarden.root
from their configuration in typical scenarios. -
Configuring
garden.root
to an empty string (""
) will behave as ifgarden.root
is configured to the current directory from whichgarden
was run. -
When a
garden.yaml
file does not exist in the current directory then garden will walk up the file system searching forgarden.yaml
or the name specified usinggarden -c <name>
. Garden will behave as if it were launched from the directory containing the garden file when a configuration file is found. -
The
GARDEN_CEILING_DIRS
andGIT_CEILING_DIRS
environment variables can be used to limit thegarden.yaml
discovery by preventinggarden
from traversing into and beyond the specified directories when discovering garden files. -
garden exec
,garden cmd
garden grow
,garden ls
and custom garden commands can now filter the trees they operate over by passing a glob pattern using-t | --trees
option. These commands will only operate on the trees whose names match the pattern. This allows you to specify a garden as the tree query and use the full set of environment variables from all trees in the query while executing commands over a subset of the trees in that garden. -
garden init
will now add the current directory to thetrees
block when the current directory contains a Git repository. Usegarden init --empty
to disable this behavior.
Development:
- The
shlex
dependency was upgraded to1.3.0
, which includes fixes for RUSTSEC-2024-0006 a.k.a. GHSA-r7qv-8r2h-pg27.
v1.1.0
Released 2024-01-15
Features:
-
garden ls
now displays information about trees, groups, gardens and commands. -
garden ls -c
(i.e.--no-commands
) hides command details from the output. -
garden plant -s
(i.e.--sort
) sorts all of the configuredtrees
entries after planting the specified trees. -
garden exec -n
(i.e.--dry-run
) performs a trial run without executing any commands. -
garden.shell-errexit
can now be configured tofalse
ingarden.yaml
to opt-out of using the-e
exit-on-error shell option when running custom commands. -
garden.shell
can now be configured tobun
,fish
,node
,perl
andpython3
in addition to the traditionalbash
,zsh
,dash
,ksh
andsh
shells. This allows you to use these interpreters to run custom commands.
Development:
- Garden is now using shellexpand v3.
v1.0.0
Released 2023-12-23
Features:
-
Commands can now specify pre-commands and post-commands that are run before/after the specified command. (#3) (documentation)
-
The default
origin
remote name can now be configured usingtree.<tree>.default-remote
. (#16) -
Commands now display the tree's current branch alongside the tree name. (#18)
-
garden -vv exec
andgarden -vv shell
now display the command being run.
Packaging:
garden
can now be installed as anix flake
package. Aflake.nix
file is now provided. (#16)
v0.9.1
Released 2023-11-19
Fixes:
garden -D name=value
now overrides variables in all scopes. Variables defined in tree scope were not subject to overrides and will now get properly overridden by the--define
/-D
command-line options.
v0.9.0
Released 2023-11-02
Features:
garden grow
now setsgit config remote.$name.tagopt --no-tags
when adding additional remotes. This prevents accidentally fetching tags when interacting with remotes.
v0.8.1
Released 2023-07-18
Fixes:
garden grow
was fixed to detect existing branches when growinggit worktree
-created child worktrees.
Development:
-
strum
is now used to implementFromStr
forenum ColorMode
. -
is-terminal is now used instead of the unmaintained
atty
crate.
v0.8.0
Released 2023-07-16
Features:
-
garden
now supports agrafts
feature that allows you to stitch configuration entities from separate garden files into a graft-specific namespace. Trees and variables from grafted configurations can be referenced usinggraft::
namespace qualifiers. -
garden grow
can now configure upstream branches. -
garden grow
can now configure gitconfig settings with multiple values usinggit config --add <name> <value>
.
v0.7.0
Released 2023-02-12
Features:
-
Trees, Groups, Gardens and Commands defined in the top-level
garden.yaml
can now override entries defined viagarden.includes
. Configuration entities now follow "last one wins" semantics -- if the same entity is defined in multiple includes files then only the final definition will be used. (#14) (#15) -
Trees now sparsely override existing entries. This behavior allows a tree definition to replace just the
url
field, or to replace individual tree commands while retaining the rest. Usereplace: true
in a Tree definition in order to completely replace the existing entry instead of sparsely overriding it. -
Improved shell completions for
garden
,garden init
andgarden plant
.
Packaging:
- 0323pin packaged
garden
for pkgsrc/NetBSD and merged the package into the main branch! (#13)
v0.6.0
Released 2023-01-20
Features:
- Both names and values in
gitconfig
can now use${var}
expressions. Previously only values were evaluated. Names are evaluated now as well.
Fixes:
- The
zsh
workaround forgarden completion zsh
is no longer needed. The documentation for generating zsh completions has been updated. (#10)
v0.5.1
Released 2023-01-15
Fixes:
- Exec expressions were previously run with the current directory set to the directory from which garden was run. Exec expressions are now run in the tree's current directory.
v0.5.0
Released 2023-01-12
Features:
-
Garden configuration files can now include other configuration files by specifying the additional files to include in the
garden.includes
field. Theincludes
feature makes it possible to create modular and reusable garden files. Thetrees
,variables
,commands
,groups
andgardens
defined in the included files are added to the current configuration. (#7) -
Garden commands can now use shell variables using the standard (brace-less) shell
$variable
syntax. The braced${garden}
variable syntax remains reserved for resolving Garden Variables. Double-$
braces (ex:$${...}
) can be used to escape a$${variable}
from evaluation so that a literal${variable}
value is used in the garden command. (#11) (#12) -
A new
garden completion
subcommand was added for providing shell command-line completion using the clap_complete crate. (#9) -
garden -V | --version
was added alongside theclap
rewrite for displaying thegarden
command version.
Development:
-
The
Makefile
has been replaced by agarden.yaml
Garden file. We can now usegarden {build, test, check, fmt, clippy, ...}
instead ofmake ...
. See garden.yaml @ 5ef8d0ab16 for more details. Packagers can usecargo install
to installgarden
and invokemdbook
directly to install the user manual. We also providegarden -D DESTDIR=/tmp/stage -D prefix=/usr/local install-doc
if distros want to install the user manual using our recipe. (#8) -
Garden's command-line parsing has been rewritten to leverage the clap crate and ecosystem.
v0.4.1
Released 2022-12-26
Features:
- The
garden cmd --no-errexit
option was extended to work with commands that are configured using a YAML list of strings. Commands that are specified using lists are now indistinguishable from commands specified using multi-line strings.
v0.4.0
Released 2022-12-23
Breaking Changes:
-
garden cmd
now runs custom commands using<shell> -e -c '<command>'
by default. The use of-e
is a change in behavior and causes multi-line / multi-statement commands to halt execution when the first non-zero exit code is encountered. Useset +e
at the top of of a multi-line command to opt-out of this behavior on a per-command basis, or specify the-n | --no-errexit
option. -
garden
will now fallback tobash
(andsh
) as the defaultgarden.shell
value whenzsh
(andbash
) are not installed. As before, thegarden.shell
configuration variable can be used to override the default shell.
Features:
-
garden prune
was added for removing orphaned Git repositories. (#4) -
garden cmd
can now run commands in breadth-first order when the-b/--breadth-first
option is used. Depth-first tree traversal is the default. Thegarden cmd --breadth-first
traversal runs all commands on a tree before continuing on to the next tree. The defaultgarden cmd
depth-first traversal runs a command across all trees before continuing on to the next command. (#3)
v0.3.0
Released 2022-08-20
Features:
garden plant
can now detectgit worktree
repositories. (#1)
v0.2.0
Released 2022-07-29
Breaking Changes:
garden add
was renamed togarden plant
.
Features:
garden grow
can now grow trees using "git worktree" (#1).garden grow
learned to clone specific branches.garden grow
andgarden plant
can now handle bare repositories.
v0.1.0
Released 2022-06-13
Features:
This is the initial garden release.
garden grow
grows worktrees.garden init
initializes configuration.garden plant
(formerlygarden add
) adds existing trees.garden cmd
andgarden <custom-command>
can run custom commands.- Templates, variables, and environment variables are all supported.