-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
At the moment, treefmt-nix overwrites the default git config when running nix flake check. This is understandable given the possibility of sensitive options or those that require user-interaction, however it also resets the diff tool used.
Describe the solution you'd like
An option to set the diff tool to a custom program, such as difftastic (pkgs.difftastic), would be useful.
Describe alternatives you've considered
I was able to patch this in manually, though obviously this isn't an ideal solution.
diff --git a/module-options.nix b/module-options.nix
index ad83f35..a19d9c7 100644
--- a/module-options.nix
+++ b/module-options.nix
@@ -315,6 +315,7 @@ in
pkgs.git
pkgs.git-lfs
config.build.wrapper
+ pkgs.difftastic
];
meta.description = "Check that the project tree is formatted";
}
@@ -334,6 +335,13 @@ in
email = nix@localhost
[init]
defaultBranch = main
+ [core]
+ conflictStyle = "diff3"
+ [diff]
+ external = "${pkgs.difftastic}/bin/difft "
+ tool = "difftastic"
+ [difftool "difftastic"]
+ cmd = "${pkgs.difftastic}/bin/difft $LOCAL $REMOTE"
EOF
git init --quiet
git add .Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request