Prune action with prefix sends duplicate --glob-archives flags to Borg #668
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#668
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'm trying to do and why
Run
prune
during a dry run to reproduce an issue discovered by a Redditor.Steps to reproduce
Using this configuration in
test.yaml
:Run the following:
This also repros without the
--dry-run
flag.Actual behavior
Expected behavior
bormgatic only sending
--glob-archives
once to Borg, no error from Borg.Other notes / implementation ideas
You'd think that the fixes and integration tests for duplicate flags in #666 would handle this case! You'd be wrong.
Environment
borgmatic version: master (after 1.7.11)
borgmatic installation method:
pip install --editable
Borg version: 1.2.4
Python version: 3.10.10
operating system and version: Manjaro Linux stable
Looking at the code (
make_prune_flags()
), it's pretty clear why this happening—the code is not even making an effort to toggle betweenprefix
making--match-archives
andarchive_name_format
making--match-archives
. It just blindly does both ifprefix
is set. Ugh, who was the joker who let this slip through? 😆Fixed in master. Will be part of the next release.
witten referenced this issue2023-04-08 21:30:27 +00:00
This fix has been released as part of borgmatic 1.7.12!