From d7a33b2580f7456b905efa4d0787e400cf731a22 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 30 Mar 2026 22:02:47 +0300 Subject: Add home_gitconfig task to deploy global git config on Linux Amp-Thread-ID: https://ampcode.com/threads/T-019d401d-bdcc-75aa-a09d-5f0e1aa626c6 Co-authored-by: Amp --- Rexfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Rexfile b/Rexfile index 5f818f3..f512415 100644 --- a/Rexfile +++ b/Rexfile @@ -267,6 +267,35 @@ task 'home_sway', sub { ensure "$DOT/waybar/*" => "$HOME/.config/waybar/"; }; +desc 'Install global git configuration'; +task 'home_gitconfig', sub { + if ( $^O eq 'linux' ) { + my %config = ( + 'user.email' => 'paul@buetow.org', + 'user.name' => 'Paul Buetow', + 'init.defaultbranch' => 'main', + 'core.editor' => 'hx', + 'core.pager' => 'delta', + 'delta.navigate' => 'true', + 'delta.side-by-side' => 'true', + 'delta.features' => 'side-by-side line-numbers decorations', + 'commit.verbose' => 'true', + 'interactive.difffilter' => 'delta --color-only', + 'diff.tool' => 'difftastic', + 'difftool.prompt' => 'false', + 'difftool.difftastic.cmd' => 'difft $LOCAL $REMOTE', + ); + + for my $key ( sort keys %config ) { + Rex::Logger::info("Setting git config $key"); + run "git config --global '$key' '$config{$key}'"; + } + } + else { + Rex::Logger::info( 'Skipping git configuration (not on Linux)', 'warn' ); + } +}; + desc 'Install my signature'; task 'home_signature', sub { ensure "$DOT/signature" => "$HOME/.signature"; -- cgit v1.2.3