Open dbarnett opened 10 months ago
I think this is a good idea. I don't really know if and when I'll have the time to implement it though.
This issue is stale because it has been open for 30 days without activity. This will be closed in 7 days, unless you add the 'lifecycle/keep-alive' label or comment.
Forgot to keep this open.
For what it's worth, to get colored diff output I've used this little Fish shell function for years, and it gets the job done nicely:
function gd
set --function diff ( \
gmailctl diff \
| grep --invert-match --extended-regexp '^(@|---|\+\+\+)' \
| string collect)
echo -n "$diff" | bat --plain --language diff
test -n "$diff" && confirm 'Apply?' && gmailctl apply --yes
end
You need bat and the confirm
helper is:
function confirm --argument-names prompt
read --function response --nchars 1 --prompt-str \
(set_color brmagenta)"■ $prompt "(set_color yellow)
test $response = y
end
Would it be possible to hook in external diff viewing tools like colordiff.org or https://dandavison.github.io/delta/ when printing config diffs?
Sometimes it's hard to read long diffs with a bunch of trivial churn to whitespace or ordering and a better diff visualizer would help a lot.