twpayne / chezmoi

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

Color output for chezmoi diff #216

Closed mgeisler closed 5 years ago

mgeisler commented 5 years ago

It would be nice to have chezmoi diff use color for the output.

As a work around, I currently use

chezmoi diff | colordiff
twpayne commented 5 years ago

Nice idea! I think some of the Go diff libraries support this. chezmoi currently uses github.com/pmezard/go-difflib, but I now see that this is no longer maintained. So, we should switch to a diff lib that supports color.

PRs welcome :) The code to change is in lib/chezmoi/logging_mutator.go.

Kevin-Mok commented 5 years ago

Someone actually made a PR to add coloring to the library, but the original creator wasn't interested in merging it. That's unfortunate.

twpayne commented 5 years ago

That's OK. People's priorities change over time. With open source, we can build on others' work even when the original author is busy,