Commit Graph

2172 Commits

Author SHA1 Message Date
Michael Eischer 064144284f restic: change LookupBlob to return []PackBlob 2026-06-05 12:22:51 +02:00
Michael Eischer 10fc70668c restic: change ListBlobs to return PackBlob
PackBlob is a limited interface that only exposes a part of the
information provided by PackedBlob. Most of the changes are switches
from direct value lookups to the interface methods, with a few larger
changes to let the tests still work.
2026-06-05 12:22:51 +02:00
Michael Eischer 781c6a12ae restic: list pack header via ListPackHandles
Replace ListPack with ListPackHandles so callers only receive blob
handles from pack headers, not layout fields.
2026-06-05 12:22:51 +02:00
Michael Eischer 122406ede6 repository: require *Repository for CopyBlobs
Prepare `CopyBlobs` to allow access to unexported methods of the
Repository struct. This requires changing the test to inject the number
of backend connections via a wrapped backend instead of a wrapped
repository.
2026-06-05 12:22:51 +02:00
Michael Eischer 5d52705064 debug: move DumpPacks into repository package
Processing pack file internals belongs into the repository package.
2026-06-04 23:23:00 +02:00
Michael Eischer 8844cf1876 repository: rename PackError to ErrPackMetadata 2026-06-04 23:17:56 +02:00
Michael Eischer 7d25ca9d67 repository: omit unused headerSize from ListPack() 2026-05-31 22:53:00 +02:00
Michael Eischer cc546b71e3 debug: move code requring internal access to repository package 2026-05-31 22:48:38 +02:00
Michael Eischer 3cb49556f5 repair index: replace full index handling integration test with unit test 2026-05-31 22:39:16 +02:00
Michael Eischer 620f5986f8 list index: use helper in repository package 2026-05-31 22:14:01 +02:00
Michael Eischer 78b3411076 check: consider split pack index entries as repository damage 2026-05-31 15:58:33 +02:00
Michael Eischer f86307d223 Merge pull request #21827 from MichaelEischer/fix-pack-repair
repair packs: correctly handle packs with missing/incomplete index entry
2026-05-31 15:57:50 +02:00
Yaroslav Halchenko 451cc6c048 Add codespell support with configuration and fixes (#21807)
Co-authored-by: Claude Code 2.1.142 / Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 20:15:13 +00:00
Michael Eischer c669cc7a7d introduce restic.Blobs type with sort method 2026-05-30 10:10:39 +02:00
Michael Eischer f000da3b35 Return helpful error if subfolder syntax fails on Windows (#21813) 2026-05-20 22:55:01 +02:00
Michael Eischer 850ab61cdf key: include full command name in subcommand descriptions 2026-05-20 22:46:11 +02:00
Michael Eischer df03e8a0ec self update: remove not possible exit codes 2026-05-20 22:46:11 +02:00
Michael Eischer 9299c45818 fix typos in cmd descriptions 2026-05-20 22:46:11 +02:00
Michael Eischer 2b72f3eb42 find: fix placement of exit status section 2026-05-20 22:46:11 +02:00
Michael Eischer 496ea804a6 check/dump/mount/repair/rewrite: update command description 2026-05-20 22:45:52 +02:00
Michael Eischer a639b8d711 Merge pull request #21811 from MichaelEischer/misc-fixes
Address various code smells, outdated comments and nits
2026-05-20 22:38:36 +02:00
Winfried Plappert 990329013e prune more aggresively (#21803)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-05-16 15:49:08 +00:00
Michael Eischer 10645ccd2a fix comment and variable name typos 2026-05-16 17:05:33 +02:00
Michael Eischer febdb8b564 find: use proper sentinel error to terminate search 2026-05-16 15:35:48 +02:00
Michael Eischer 91c2aefbe1 Document openWithReadLock usage of read-only backend mode 2026-05-16 15:35:48 +02:00
Paulo Saraiva 6de6cc6c75 Show progress for restic stats (#5705)
Co-authored-by: Paulo Saraiva <paulo.saraiva@cern.ch>
2026-05-15 20:31:20 +02:00
Michael Eischer 8abbc3703d doc: update embedded help output and misc typos (#21804) 2026-05-15 20:21:04 +02:00
Michael Eischer f3854cf299 Merge pull request #21796 from restic/go-1.25
Bump minimum go version to 1.25 & update dependencies
2026-05-12 18:56:09 +02:00
Michael Eischer 7ee77133fc Merge pull request #21781 from mattxtaz2/master 2026-05-10 22:20:24 +02:00
Michael Eischer f8afd4ed04 key passwd: test that user and host flags are handled 2026-05-10 22:13:16 +02:00
Michael Eischer 4c94678d7d fix linter and compilation issues 2026-05-10 17:53:29 +02:00
Michael Eischer 39084a912e Merge pull request #5700 from MichaelEischer/err-invalid-env 2026-05-10 00:18:40 +02:00
Michael Eischer b24d210b45 mount: load mount root before reporting readiness 2026-05-07 22:42:03 +02:00
Matt 0f8c28aee4 Add opts.Username, opts.Hostname to AddKey in the "key passwd" command
so that --user and --host flags work
2026-04-16 19:15:44 +01:00
Winfried Plappert 54347eb6fa Enhancement: restic find - more integration tests (#5672) 2026-02-26 21:52:26 +01:00
Winfried Plappert f9b63050eb Bugfix: `restic find --pack <tree-pack>` did not produce output for tree packs (#5664) 2026-02-25 21:24:31 +01:00
Johannes Truschnigg a8f0ad5cc4 mount: check for more requisite mountpoint conditions (#5718)
* mount: check for more requisite mountpoint conditions

In order to be able to mount a repository over a mountpoint target
directory via FUSE, that target directory needs to be both writeable and
executable for the UID performing the mount.

Without this patch, `restic mount` only checks for the target pathname's
existence, which can lead to a lot of data transfer and/or computation
for large repos to be performed before eventually croaking with a fatal
"fusermount: failed to chdir to mountpoint: Permission denied" (or
similar) error.

FUSE does allow for mounting over a target path that refers to a regular
(writeable) file, but the result is not accessible via chdir(), so we
prevent that as well, and accept only directory inodes as the intended
target mountpoint path.

* Don't use snake_case identifiers

* Add changelog entry

* tweak changelog summary

---------

Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-02-19 17:11:49 +00:00
Winfried Plappert 8b567a9270 Bugfix restic find: missing check for mtime --oldest/--newest (#5310) 2026-02-18 21:14:35 +00:00
Andreas Scherbaum 66d915ef79 Add space in error message (#5704) 2026-02-18 20:27:02 +00:00
Michael Eischer 6566f786e9 stats: also print snapshot size statistics in debug mode (#5712) 2026-02-18 21:21:40 +01:00
Michael Eischer 5be6d9c73f fail of RESTIC_READ_CONCURRENCY or RESTIC_COMPRESSION are invalid 2026-02-01 15:57:07 +01:00
gunar 7101f11133 Fail fast for invalid RESTIC_PACK_SIZE env values (#5592)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-02-01 15:45:31 +01:00
Michael Eischer 5e43a44b15 Merge pull request #5680 from castilma/unlock-doc 2026-02-01 12:13:52 +01:00
Michael Eischer 07d380d54b Merge pull request #5191 from wplapper/cmd_rewrite_include 2026-02-01 11:53:05 +01:00
Winfried Plappert bcd4168428 Enhancement: calls to SnapshotFilter.FindLatest() can be simplified (#5688) 2026-01-31 23:04:01 +01:00
Michael Eischer 901235efc9 rewrite: skip snapshot parts not matchable by include patterns 2026-01-31 22:42:02 +01:00
Michael Eischer 0d71f70a22 minor cleanups and typos 2026-01-31 22:01:23 +01:00
Winfried Plappert b6af01bb28 restic rewrite integration test
convert exclusive lock on repository to 'no-lock'
2026-01-31 19:43:03 +00:00
Winfried Plappert 5148608c39 restic rewrite include - based on restic 0.18.1
cmd/restic/cmd_rewrite.go:
introduction of include filters for this command:
- add include filters, add error checking code
- add new parameter 'keepEmptyDirectoryFunc' to 'walker.NewSnapshotSizeRewriter()',
  so empty directories have to be kept to keep the directory structure intact
- add parameter 'keepEmptySnapshot' to 'filterAndReplaceSnapshot()' to keep snapshots
  intact when nothing is to be included
- introduce helper function 'gatherIncludeFilters()' and 'gatherExcludeFilters()' to
  keep code flow clean

cmd/restic/cmd_rewrite_integration_test.go:
add several new tests around the 'include' functionality

internal/filter/include.go:
this is where is include filter is defined

internal/walker/rewriter.go:
- struct RewriteOpts gains field 'KeepEmtpyDirectory', which is a 'NodeKeepEmptyDirectoryFunc()'
  which defaults to nil, so that al subdirectories are kept
- function 'NewSnapshotSizeRewriter()' gains the parameter 'keepEmptyDirecoryFilter' which
  controls the management of empty subdirectories in case of include filters active

internal/data/tree.go:
gains a function Count() for checking the number if node elements in a newly built tree

internal/walker/rewriter_test.go:
function 'NewSnapshotSizeRewriter()' gets an additional parameter nil to keeps things happy

cmd/restic/cmd_repair_snapshots.go:
function 'filterAndReplaceSnapshot()' gets an additional parameter 'keepEmptySnapshot=nil'

doc/045_working_with_repos.rst:
gets to mention include filters

changelog/unreleased/issue-4278:
the usual announcement file

git rebase master -i produced this

restic rewrite include - keep linter happy

cmd/restic/cmd_rewrite_integration_test.go:
linter likes strings.Contain() better than my strings.Index() >= 0
2026-01-31 19:42:56 +00:00
Michael Eischer 24d56fe2a6 diff: switch to efficient DualTreeIterator
The previous implementation stored the whole tree in a map and used it
for checking overlap between trees. This is now replaced with the
DualTreeIterator, which iterates over two trees in parallel and returns
the merge stream in order. In case of overlap between both trees, it
returns both nodes at the same time. Otherwise, only a single node is
returned.
2026-01-31 20:03:38 +01:00