Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support diffing with colordiff/delta/etc #371

Open
dbarnett opened this issue Nov 25, 2023 · 4 comments
Open

Support diffing with colordiff/delta/etc #371

dbarnett opened this issue Nov 25, 2023 · 4 comments
Labels
kind/feature New feature or request lifecycle/keep-alive Denotes an issues or PR that should never be considered stale.

Comments

@dbarnett
Copy link

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.

@mbrt
Copy link
Owner

mbrt commented Nov 27, 2023

I think this is a good idea. I don't really know if and when I'll have the time to implement it though.

@mbrt mbrt added the kind/feature New feature or request label Nov 27, 2023
Copy link
Contributor

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.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity, has become stale and will be auto-closed. label Dec 28, 2023
@github-actions github-actions bot closed this as completed Jan 4, 2024
@mbrt mbrt added lifecycle/keep-alive Denotes an issues or PR that should never be considered stale. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity, has become stale and will be auto-closed. labels Jan 4, 2024
@mbrt mbrt reopened this Jan 4, 2024
@mbrt
Copy link
Owner

mbrt commented Jan 4, 2024

Forgot to keep this open.

@serban
Copy link

serban commented May 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request lifecycle/keep-alive Denotes an issues or PR that should never be considered stale.
Projects
None yet
Development

No branches or pull requests

3 participants