From e2d2f8aeb2d86223f46081b3c5983c7cdd6cbcc9 Mon Sep 17 00:00:00 2001 From: Mischa Diehm Date: Fri, 24 Apr 2026 08:46:34 +0200 Subject: [PATCH] Use cat for git-crypt textconv Git applies the smudge filter before invoking the diff textconv command, so encrypted blobs have already been decrypted by the time textconv runs. The textconv command only needs to pass that plaintext through to Git's diff machinery. Using cat avoids invoking git-crypt diff redundantly during diff generation. --- commands.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commands.cpp b/commands.cpp index 6b3c498..afbce09 100644 --- a/commands.cpp +++ b/commands.cpp @@ -164,13 +164,12 @@ static void configure_git_filters (const char* key_name) git_config(std::string("filter.git-crypt-") + key_name + ".clean", escaped_git_crypt_path + " clean --key-name=" + key_name); git_config(std::string("filter.git-crypt-") + key_name + ".required", "true"); - git_config(std::string("diff.git-crypt-") + key_name + ".textconv", - escaped_git_crypt_path + " diff --key-name=" + key_name); + git_config(std::string("diff.git-crypt-") + key_name + ".textconv", "cat"); } else { git_config("filter.git-crypt.smudge", escaped_git_crypt_path + " smudge"); git_config("filter.git-crypt.clean", escaped_git_crypt_path + " clean"); git_config("filter.git-crypt.required", "true"); - git_config("diff.git-crypt.textconv", escaped_git_crypt_path + " diff"); + git_config("diff.git-crypt.textconv", "cat"); } }