all repos — nixfiles @ ca30c291884e7751dcd93378492502ac79847a5c

System and user configuration, managed by nix and home-manager

git: install mergiraf for semantic merging
Alan Pearce alan@alanpearce.eu
Tue, 04 Mar 2025 10:51:11 +0100
commit

ca30c291884e7751dcd93378492502ac79847a5c

parent

f291e3cf780d1dc2f834a17a06b8f54a91a417e5

1 files changed, 10 insertions(+), 0 deletions(-)

jump to
M user/settings/git.nixuser/settings/git.nix
@@ -70,6 +70,10 @@ };       merge = {
         conflictStyle = "zdiff3";
       };
+      "merge.mergiraf" = {
+        name = "mergiraf";
+        driver = "${pkgs.mergiraf}/bin/mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P -l %L";
+      };
       diff = {
         algorithm = "histogram";
         colorMoved = "plain";
@@ -159,11 +163,17 @@ "diff.tool" = [ "${pkgs.difftastic}/bin/difft" "--color=always" "$left" "$right" ];       };
     };
   };
+  xdg.configFile."git/attributes" = {
+    source = (pkgs.runCommandLocal "mergiraf-gitattributes" { } ''
+      ${pkgs.mergiraf}/bin/mergiraf languages --gitattributes >> $out
+    '');
+  };
   home.packages = with pkgs; [
     git-extras # delete-merged-branches and friends
     git-worktree-switcher
     ghq
     # reduce these on server
+    mergiraf
     gitui
     gitstatus
     hut # sourcehut tools