tag options: one tag per option, fixes #10430 - #10432
Merged
ThomasWaldmann merged 7 commits intoSep 26, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10432 +/- ##
==========================================
+ Coverage 88.63% 88.65% +0.01%
==========================================
Files 103 103
Lines 19206 19217 +11
Branches 2990 2993 +3
==========================================
+ Hits 17024 17036 +12
+ Misses 1516 1513 -3
- Partials 666 668 +2 ☔ View full report in Codecov by Harness. |
ThomasWaldmann
added a commit
to borgbackup/borgstore
that referenced
this pull request
Sep 25, 2026
Path.rename() replaces an existing destination on POSIX, but raises FileExistsError on Windows. Use Path.replace() so move() behaves the same everywhere and like the other backends, which all overwrite the target. This broke e.g. soft-deleting an item while a soft-deleted item of the same name already existed (borgbackup/borg#10432 CI). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThomasWaldmann
force-pushed
the
tag-append-10430
branch
from
September 26, 2026 10:50
a0b1cfc to
82de390
Compare
…0430 They used nargs="*" and thus swallowed the archive NAME if it was given after them, e.g. "borg tag --set keep aid:1ddaae55" failed. Now each option takes exactly one tag and can be given multiple times, e.g. "borg tag --add a --add b NAME". Also add examples to the "borg tag" help. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Special tags like @prot are kept. --clear can be combined with --add to replace the normal tags, it is mutually exclusive with --set. Previously, a bare "--set" cleared all tags, but that is not possible anymore since --set now takes exactly one tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--tags used nargs="+" and thus swallowed the archive NAME if it was given after it, e.g. "borg create --tags foo NAME PATH" failed. Now --tag takes exactly one tag and can be given multiple times, e.g. "borg create --tag foo --tag bar NAME PATH". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without NAME or archive filter options, "borg tag --set/--clear/--add/--remove" silently changed the tags of all archives in the repository. Now it aborts like "borg delete" does, unless archives are selected explicitly, e.g. using -a 'sh:*' for all archives. Just showing the tags of all archives still works without a selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Previously, borg silently did not set the tags, so it looked like the given tags were just ignored, and the return code was 0. Now borg emits a warning naming the special tags that would be removed and exits with rc 1 (warning). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Document that tags: takes a comma-separated list of tags and matches archives having all of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Previously, "borg tag" always rewrote the archive metadata (and thus the archive entry in the repository), even when just listing the tags or when the requested change was a no-op (including a refused --set). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ThomasWaldmann
force-pushed
the
tag-append-10430
branch
from
September 26, 2026 21:21
0b469b7 to
cce5c99
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10430.
borg tag --set/--add/--removeandborg create --tagstook multiple tags per option (nargs="*"/nargs="+"), so they swallowed the archive NAME if it came after them, e.g.borg tag --set keep aid:1ddaae55failed with a confusing error.Changes
--set,--addand--removetake exactly one tag and can be given multiple times, e.g.borg tag --add a --add b NAME. Also added examples toborg tag --help.--clearremoves all normal tags, but keeps special tags like@PROT. It can be combined with--addto replace the normal tags and is mutually exclusive with--set. This replaces the previous way of clearing tags with a bare--set, which is not possible anymore.--tagsis replaced by--tag, taking one tag per option, e.g.borg create --tag foo --tag bar NAME PATH.borg deletedoes. Use-a 'sh:*'to change all archives. Just showing the tags of all archives still works without a selection.--setis refused because it would remove pre-existing special tags. Previously this was silent and returned rc 0.tags:match pattern takes a comma-separated list and matches archives having all of the given tags.Implementation note
The repeatable options use
action="extend", nargs=1rather thanaction="append": jsonargparse re-validates parsed values after parsing and, fornargs=None, calls thetypeon the whole appended list, which breaks the tag validator. Withextend+nargs=1, it gets a flat list and checks each element; keepingtype=tag_validatoralso keeps shell completion for tags working.🤖 Generated with Claude Code