From aea96b7d86f3b2eda0e4009805cba134aafab6e8 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Wed, 28 Dec 2022 17:46:06 +0100 Subject: [PATCH 1/2] check: Slightly improve help message If a repository has both pack/index related warnings and errors, then the help message is quite misleading. Reword it slightly to be more clear. --- cmd/restic/cmd_check.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go index 68198377f..7fafe0ee9 100644 --- a/cmd/restic/cmd_check.go +++ b/cmd/restic/cmd_check.go @@ -245,7 +245,7 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args } if suggestIndexRebuild { - Printf("This is non-critical, you can run `restic rebuild-index' to correct this\n") + Printf("Duplicate packs/old indexes are non-critical, you can run `restic rebuild-index' to correct this.\n") } if mixedFound { Printf("Mixed packs with tree and data blobs are non-critical, you can run `restic prune` to correct this.\n") From 8430399fce2662f0ced9972f84a141508ede4f31 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Wed, 28 Dec 2022 17:47:27 +0100 Subject: [PATCH 2/2] check: Partially fix garbled output When reporting an error for a tree, the output message can overlap with the progress bar output, e.g. `error for tree e91ef6fb:napshots`. The fix only applies for this specific message and does not work on Windows. --- cmd/restic/cmd_check.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go index 7fafe0ee9..be9dd5130 100644 --- a/cmd/restic/cmd_check.go +++ b/cmd/restic/cmd_check.go @@ -295,7 +295,11 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args for err := range errChan { errorsFound = true if e, ok := err.(*checker.TreeError); ok { - Warnf("error for tree %v:\n", e.ID.Str()) + var clean string + if stdoutCanUpdateStatus() { + clean = clearLine(0) + } + Warnf(clean+"error for tree %v:\n", e.ID.Str()) for _, treeErr := range e.Errors { Warnf(" %v\n", treeErr) }