From b5e32770a3aefd17a657327b05438def07fb5dbf Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 5 Jan 2026 15:23:45 +1100 Subject: [PATCH] Ignore files that end with a tilde (probably backup files generated by editors) --- CHANGELOG.md | 1 + enroll/ignore.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19906cc..9320ee0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * Introduce `enroll explain` - a tool to analyze and explain what's in (or not in) a harvest and why. * Centralise the cron and logrotate stuff into their respective roles, we had a bit of duplication between roles based on harvest discovery. * Capture other files in the user's home directory such as `.bashrc`, `.bash_aliases`, `.profile`, if these files differ from the `/etc/skel` defaults + * Ignore files that end with a tilde (probably backup files generated by editors) # 0.2.3 diff --git a/enroll/ignore.py b/enroll/ignore.py index 895c030..a079346 100644 --- a/enroll/ignore.py +++ b/enroll/ignore.py @@ -100,6 +100,9 @@ class IgnorePolicy: # Always ignore plain *.log files (rarely useful as config, often noisy). if path.endswith(".log"): return "log_file" + # Ignore editor/backup files that end with a trailing tilde. + if path.endswith("~"): + return "tilde_backup" if not self.dangerous: for g in self.deny_globs or []: