From 17f5736495ea4a219d70fbef696c1b43bac00128 Mon Sep 17 00:00:00 2001 From: Bernhard Guillon Date: Tue, 7 Jul 2026 20:11:43 +0200 Subject: Show file count before initial sync starts --- cmd_linux.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cmd_linux.go b/cmd_linux.go index d9d392e..9a4da36 100644 --- a/cmd_linux.go +++ b/cmd_linux.go @@ -180,18 +180,16 @@ func syncFromManifest(remote *Manifest, stack *GitignoreStack) { localManifest := scanLocalDirectory(*dataDir) + // First pass: count what needs syncing + var toSync []string for relPath, remoteMeta := range remote.Files { if isGitDir(relPath) { continue } if stack.IsIgnored(relPath) { - stats.skipped++ continue } - destPath := filepath.Join(*dataDir, relPath) - srcPath := filepath.Join(*hostDir, relPath) - if localMeta, exists := localManifest.Files[relPath]; exists { if localMeta.Size == remoteMeta.Size && localMeta.Mode == remoteMeta.Mode && @@ -201,6 +199,15 @@ func syncFromManifest(remote *Manifest, stack *GitignoreStack) { } } + toSync = append(toSync, relPath) + } + logInfo("manifest: %d files to sync", len(toSync)) + + // Second pass: sync + for _, relPath := range toSync { + destPath := filepath.Join(*dataDir, relPath) + srcPath := filepath.Join(*hostDir, relPath) + info, err := os.Lstat(srcPath) if err != nil { if os.IsNotExist(err) { -- cgit v1.2.3