From 48a9f9b11efdfeac5f99127618483b6450b27311 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 29 Nov 2021 13:13:43 +0100 Subject: [PATCH] home: git: use diff-highlight in interactive diffs Now even `git log -p` and `git add -p` can use the more readable diffs. --- home/git/default.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/home/git/default.nix b/home/git/default.nix index e9ccde8..432bf60 100644 --- a/home/git/default.nix +++ b/home/git/default.nix @@ -3,6 +3,7 @@ let cfg = config.my.home.git; inherit (lib.my) mkMailAddress; + diff-highlight = "${pkgs.gitAndTools.gitFull}/share/git/contrib/diff-highlight/diff-highlight"; in { options.my.home.git = with lib.my; { @@ -99,15 +100,15 @@ in defaultBranch = "main"; }; - pager = - let - diff-highlight = "${pkgs.gitAndTools.gitFull}/share/git/contrib/diff-highlight/diff-highlight"; - in - { - diff = "${diff-highlight} | less"; - log = "${diff-highlight} | less"; - show = "${diff-highlight} | less"; - }; + interactive = { + diffFilter = "${diff-highlight}"; + }; + + pager = { + diff = "${diff-highlight} | less"; + log = "${diff-highlight} | less"; + show = "${diff-highlight} | less"; + }; pull = { # Avoid useless merge commits