borgbackup / borgbackup/borg

borg2: Allow comma-separated archive IDs in `aid:` matcher

Open
#10,313 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13.7k
Forks
875
Avg merge
11h 15m
Merged PRs (30d)
192

Description

The `aid:` archive match pattern currently matches exactly one archive ID. Multiple `-a` / `--match-archives` options are combined using AND semantics, so there is currently no convenient way to explicitly select multiple archives by their unique IDs.

For example, the following does not match either archive, since an archive cannot have both IDs:

```
$ borg2 repo-list -r /run/media/daniel/prometheus/Borg/ -a aid:8961fcf1 -a aid:466b7c4d
Command error: archive ID based match needs to match precisely one archive ID
```

**Suggestion**

Allow `aid:` to accept a comma-separated list of archive IDs, with OR semantics within the pattern. All archive IDs given must still match exactly one archive.

For example:

```
$ borg2 repo-list -r /run/media/daniel/prometheus/Borg/ -a aid:8961fcf1,466b7c4d
8961fcf1 Mon, 2026-08-24 11:24:32 +0200 Tuxedo-InfinityBook-14 daniel Tuxedo-InfinityBook-14 Arch Linux (Last Update: 2026-08-20T00:1
466b7c4d Tue, 2026-08-25 12:21:14 +0200 Tuxedo-InfinityBook-14 daniel Tuxedo-InfinityBook-14 Arch Linux (Last Update: 2026-08-24T15:4
```

This could retain the current behavior for a single ID while providing a simple way to explicitly select multiple known archives.

**Benefits**

This would

* allow explicitly selecting multiple unique archives,
* avoid requiring multiple matcher options with different semantics,
* make `aid:` more useful for scripts and other programmatic archive selection,
* allow processing multiple explicitly selected archives in a single `borg2` invocation instead of running `borg2` separately for each archive, which can reduce overall runtime.

Contributor guide

Open the contributing guide

Research direction

Start with the borg2 repo-list entry point and the -a/--match-archives handling for the aid: pattern. Trace how a single archive ID is validated and matched, then verify that comma-separated IDs use OR semantics while each ID still matches exactly one archive; confirm the examples select both archives.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.