Perform multiple includes at the same scope level #732
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#732
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'd like to do and why
In more complex borgmatic configurations, it's not uncommon for a single configuration file to pull in multiple includes for purposes of option reuse. Prior to #721 (removal of config sections), users often did that reuse at the level of one include per configuration section. However, with sections deprecated now (and ultimately going away), that include scope is no longer really available. Which leads to the logical next step of doing those includes at global scope. However, due to a YAML limitation, a single scope can't have multiple "<<:" keys and therefore multiple global includes don't work.
As a solution to this problem, I propose simply allowing multiple file includes in a single include statement. For instance, maybe something like this:
And this (both supported):
That should work around the YAML limitation and allow the user to perform multiple includes—even if they're all at the same scope.
Other notes / implementation ideas
It would probably make sense for the listed includes to be included/applied in listed order, such that the final include overrides the previous ones.
This is implemented in main and will be part of the next release! Documentation here: https://torsion.org/borgmatic/docs/how-to/make-per-application-backups/#multiple-merge-includes
Just released in borgmatic 1.8.1!