twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.
https://www.chezmoi.io/
MIT License
12.63k stars 475 forks source link

Chezmoi diff is different from chezmoi apply diff #3523

Open dgudim opened 7 months ago

dgudim commented 7 months ago

I have changed chezmoi's diff in the config file to delta.

[diff]
    command = "delta"
    exclude = ["scripts"]
    args = ["--pager=0", "{{`{{ .Destination }}`}}", "{{`{{ .Target }}`}}"]

chezmoi diff does what I expect

image

However, during chezmoi apply there is an option to view diff of a file if it was changed externally, and that is still using the default diff. Can I somehow change that?

image

halostatue commented 7 months ago

I don't think that this exists right now.

twpayne commented 7 months ago

Thanks for reporting this. diff.command should be used by the prompt in chezmoi apply and it's a bug that it's not.

twpayne commented 7 months ago

In the short term you can work around this by adding:

[diff]
    pager = "delta"

to your config file (this is in addition to diff.command being set to delta).