summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/gitconfig3
-rw-r--r--default.nix13
2 files changed, 15 insertions, 1 deletions
diff --git a/base/gitconfig b/base/gitconfig
index eb1ca38..8732a4d 100644
--- a/base/gitconfig
+++ b/base/gitconfig
@@ -1,6 +1,9 @@
[include]
path = custom
+[diff]
+ external = "difft --display inline"
+
[push]
default = simple
diff --git a/default.nix b/default.nix
index 2bec5ec..77e799d 100644
--- a/default.nix
+++ b/default.nix
@@ -47,7 +47,17 @@ in rec {
git = pkgs.writeScriptBin "git" ''
#!${pkgs.bash}/bin/bash
export XDG_CONFIG_HOME=${gitConfig}
- exec ${pkgs.git}/bin/git "$@"
+ bin="${pkgs.git}/bin/git"
+
+ # Overwrite show an log sub-commands to always set --ext-diff. git aliases
+ # don't allow for overwritting sub-commands, or I'd use them instead.
+ if [ "$1" = "show" ] || [ "$1" = "log" ]; then
+ subCmd="$1"
+ shift
+ exec "$bin" "$subCmd" --ext-diff "$@"
+ fi
+
+ exec "$bin" "$@"
'';
bin = pkgs.buildEnv {
@@ -78,6 +88,7 @@ in rec {
pkgs.less
pkgs.tmux
pkgs.calc
+ pkgs2305.difftastic
pkgs.man
pkgs.man-pages