aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Guillon <Bernhard.Guillon@begu.org>2026-07-07 22:08:49 +0200
committerBernhard Guillon <Bernhard.Guillon@begu.org>2026-07-07 22:08:49 +0200
commit4cb0b6cde565291bee4c7d094ea0d0d7fa4f26ce (patch)
tree0b8b400c0a1626f64bd2b18189bb2af6571e28f2
parente7bb8c7c595fc9e2a024c2694596750b6a9f6480 (diff)
downloadsourcewatch-4cb0b6cde565291bee4c7d094ea0d0d7fa4f26ce.tar.gz
sourcewatch-4cb0b6cde565291bee4c7d094ea0d0d7fa4f26ce.zip
Add debug logging for sync comparison mismatches
-rw-r--r--cmd_linux.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd_linux.go b/cmd_linux.go
index 9a4da36..390e431 100644
--- a/cmd_linux.go
+++ b/cmd_linux.go
@@ -182,6 +182,8 @@ func syncFromManifest(remote *Manifest, stack *GitignoreStack) {
// First pass: count what needs syncing
var toSync []string
+ var debugShown int
+ var missingLocal int
for relPath, remoteMeta := range remote.Files {
if isGitDir(relPath) {
continue
@@ -197,10 +199,22 @@ func syncFromManifest(remote *Manifest, stack *GitignoreStack) {
localMeta.Symlink == remoteMeta.Symlink {
continue
}
+ if debugShown < 5 {
+ logDebug("mismatch %s: size=%d/%d mode=%o/%o modtime=%v/%v symlink=%q/%q",
+ relPath,
+ localMeta.Size, remoteMeta.Size,
+ localMeta.Mode, remoteMeta.Mode,
+ localMeta.ModTime, remoteMeta.ModTime,
+ localMeta.Symlink, remoteMeta.Symlink)
+ debugShown++
+ }
+ } else {
+ missingLocal++
}
toSync = append(toSync, relPath)
}
+ logInfo("manifest: %d files to sync (%d missing locally, %d mismatched)", len(toSync), missingLocal, len(toSync)-missingLocal)
logInfo("manifest: %d files to sync", len(toSync))
// Second pass: sync