borg icon indicating copy to clipboard operation
borg copied to clipboard

implement pattern support for --match-archives, fixes #6504

Open ThomasWaldmann opened this issue 3 years ago • 4 comments

also:

  • rename --glob-archives option to --match-archives (short: -a)
  • globbing patterns now need sh: prefix
  • regex patterns need re: prefix
  • "identical" match "pattern" uses an id: prefix
  • new default is id: pattern (--glob-archives used sh: glob pattern)
  • source code: glob -> match, GLOB -> PATTERN

ThomasWaldmann avatar Sep 16 '22 12:09 ThomasWaldmann

Codecov Report

Merging #7028 (eb46639) into master (f5df35b) will increase coverage by 0.00%. The diff coverage is 83.33%.

:exclamation: Current head eb46639 differs from pull request most recent head 4493d39. Consider uploading reports for the commit 4493d39 to get more accurate results

@@           Coverage Diff           @@
##           master    #7028   +/-   ##
=======================================
  Coverage   83.31%   83.31%           
=======================================
  Files          66       66           
  Lines       11305    11317   +12     
  Branches     2265     2268    +3     
=======================================
+ Hits         9419     9429   +10     
- Misses       1350     1352    +2     
  Partials      536      536           
Impacted Files Coverage Δ
src/borg/archiver/_common.py 90.44% <ø> (ø)
src/borg/archiver/check_cmd.py 74.41% <0.00%> (ø)
src/borg/archiver/delete_cmd.py 71.59% <0.00%> (ø)
src/borg/archiver/help_cmd.py 76.92% <ø> (ø)
src/borg/archiver/prune_cmd.py 89.14% <ø> (ø)
src/borg/archive.py 82.90% <71.42%> (ø)
src/borg/archiver/__init__.py 86.53% <100.00%> (ø)
src/borg/manifest.py 93.22% <100.00%> (+0.03%) :arrow_up:
src/borg/patterns.py 91.82% <100.00%> (+0.45%) :arrow_up:
src/borg/platform/base.py 79.83% <0.00%> (-1.62%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Sep 16 '22 12:09 codecov-commenter

default style: shall we rather default to the simpler id: or the more powerful sh:?

id: might be a bit more on the safe side (avoiding unintentional use of magic, like wildcards).

sh: might be more on the comfortable side (not needing to prepend sh:). we also default to shell style patterns for --pattern option.

ThomasWaldmann avatar Sep 16 '22 12:09 ThomasWaldmann

Note: the borg 1.2 pendant (--glob-archives) used globbing (== sh:).

ThomasWaldmann avatar Sep 16 '22 20:09 ThomasWaldmann

15:11  tao$ i think a basic string match should be the default with glob/regex matching a configurable prefix

ThomasWaldmann avatar Sep 20 '22 13:09 ThomasWaldmann