Skip to content

[Feature request] rustic ls --name <name> #1676

@fvsch

Description

@fvsch

Hi there.

I’m using rustic 0.11.0 and trying to use rustic ls to check which files are considered (i.e. not ignored), based on #1645 which suggests this would be possible.

Indeed it does work, but my issue is that it ignores snapshot-specific configuration.

My rustic.toml contains:

[backup]
iglobs = ["!.DS_Store", "!._*"]

[[backup.snapshots]]
name = "Dotfiles"
sources = ["$HOME/.config"]
globs = ["!raycast/", "!zed/"]

(I’m using both iglobs and globs so that one doesn't overwrite the other, see #1647 about that.)

With 0.11.0 I can use rustic ls ./.config to list files, but this will only use the backup.iglobs config, and it will ignore the globs config for the Dotfiles snapshot. Which means the produced list of files does not match what rustic backup or rustic backup --name Dotfiles would do.

Possible fixes:

  1. Add support for the --name option to rustic ls. Then I could use rustic ls --name Dotfiles to get the result I want.
  2. Automatically detect that the provided path is a source for a specific snapshot, and apply its config.

Second one looks error-prone, and tricky when a path is a source in more than one configured snapshot. So my vote would be on the --name option, which removes ambiguity (and enables listing files from multiple source paths, when a snapshot is configured with multiple sources).

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-triageStatus: Waiting for a maintainer to triage this issue/PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions