From 054b467f328e38a70d65a30199ab54843364a0be Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 18 May 2021 16:20:17 +0100 Subject: [PATCH] check: log the hash in use like cryptcheck does See: https://forum.rclone.org/t/does-a-rclone-check-on-similar-remotes-still-compute-hashes/24288/15 --- cmd/check/check.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/check/check.go b/cmd/check/check.go index 505aa6fe5..11117b147 100644 --- a/cmd/check/check.go +++ b/cmd/check/check.go @@ -9,6 +9,7 @@ import ( "github.com/rclone/rclone/cmd" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/config/flags" + "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/operations" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -156,6 +157,12 @@ to check all the data. if download { return operations.CheckDownload(context.Background(), opt) } + hashType := fsrc.Hashes().Overlap(fdst.Hashes()).GetOne() + if hashType == hash.None { + fs.Errorf(nil, "No common hash found - not using a hash for checks") + } else { + fs.Infof(nil, "Using %v for hash comparisons", hashType) + } return operations.Check(context.Background(), opt) }) },