From 12ad0c0d2f0acb2cb869e2c0217e79eb9adabc64 Mon Sep 17 00:00:00 2001 From: Xevion Date: Fri, 8 Nov 2024 17:35:11 -0600 Subject: [PATCH] Add .gitconfig enabling diff'ing for encrypted .age files --- .gitattributes | 3 ++- .gitconfig | 2 ++ home/run_onchange_gitconfig.sh.tmpl | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .gitconfig create mode 100644 home/run_onchange_gitconfig.sh.tmpl diff --git a/.gitattributes b/.gitattributes index 7a17dfd..70dddb9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,4 +7,5 @@ dot_profile linguist-language=Shell dot_gitconfig linguist-language=TOML linguist-detectable *.toml linguist-detectable *.toml.tmpl linguist-language=TOML linguist-detectable -*.cfg.tmpl linguist-language=INI linguist-detectable \ No newline at end of file +*.cfg.tmpl linguist-language=INI linguist-detectable +*.age diff=age \ No newline at end of file diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..9f0e9e0 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,2 @@ +[diff "age"] + textconv = "age -d -i ~/key.txt" \ No newline at end of file diff --git a/home/run_onchange_gitconfig.sh.tmpl b/home/run_onchange_gitconfig.sh.tmpl new file mode 100644 index 0000000..f0c66b1 --- /dev/null +++ b/home/run_onchange_gitconfig.sh.tmpl @@ -0,0 +1,6 @@ +#!/bin/sh + +# We just need to have access to the Git repository +cd {{ .chezmoi.sourceDir }} +# The path is relative to the .git/config file +git config --local include.path ../.gitconfig