difftastic: fix jujutsu integration
Don’t append `--color=always` and `--sort-paths` unconditionally, since
`difftastic` doesn’t like repeated arguments, and the user might have
already set them (via `config.programs.difftastic.options`).
To clarify, if `difft` gets called with any parameter repeated, it will
croak:
difft --color=always --color=always
error: the argument '--color <WHEN>' cannot be used multiple times
Usage: difft [OPTIONS] OLD-PATH NEW-PATH
For more information, try '--help'.
By patching `cfg.options` we ensure that the parameters are defined, and
have the required value, since the user might have selected differently
for their general setup (again, via `config.programs.difftastic.options`).
This commit is contained in:
parent
a7209b6794
commit
bfb67e07a3
1 changed files with 7 additions and 3 deletions
|
|
@ -188,10 +188,14 @@ in
|
|||
programs.jujutsu.settings.ui.diff-formatter = [
|
||||
(lib.getExe cfg.package)
|
||||
]
|
||||
++ (lib.cli.toCommandLineGNU { } cfg.options)
|
||||
++ (lib.cli.toCommandLineGNU { } (
|
||||
cfg.options
|
||||
// {
|
||||
color = "always";
|
||||
sort-paths = true;
|
||||
}
|
||||
))
|
||||
++ [
|
||||
"--color=always"
|
||||
"--sort-paths"
|
||||
"$left"
|
||||
"$right"
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue