From 73a031b677cfa85c23e026e4358cf3417102d550 Mon Sep 17 00:00:00 2001 From: Matteo Cherubini Date: Sun, 10 May 2026 15:11:03 +0200 Subject: [PATCH] feat: Generalize git-crypt rules in .gitattributes --- templates/gitattributes | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/templates/gitattributes b/templates/gitattributes index 226c36e..700b6eb 100644 --- a/templates/gitattributes +++ b/templates/gitattributes @@ -1,17 +1,14 @@ -# --- Encryption Rules for Genomes --- -# These directories are stored as encrypted AES-256 blobs on the remote server. -# They require git-crypt and the specific genome key to be readable. - -raw/private/** filter=git-crypt diff=git-crypt -wiki/private/** filter=git-crypt diff=git-crypt - -# --- Binary Integrity --- -# Prevent line-ending conversion for encrypted files to avoid corruption. -raw/private/** -text -wiki/private/** -text - # --- Standard Text Configuration --- *.md text eol=lf *.sh text eol=lf *.env text eol=lf Makefile text eol=lf + +# --- Encryption Rules --- +# MUST come after text rules: in .gitattributes the last matching rule wins per attribute. +# Placing **/private/** here ensures -text overrides the *.md text=lf rule above, +# preventing EOL conversion from corrupting AES-256 encrypted blobs. +# +# **/private/** catches any private/ directory at any depth in the repo, +# including directories created at runtime by the LLM agent. +**/private/** filter=git-crypt diff=git-crypt -text