diff options
| author | Jose Maldonado <63384398+yukiteruamano@users.noreply.github.com> | 2026-03-06 19:17:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-06 15:17:42 -0800 |
| commit | 011e7b999552f3c0730035183a4a6dfb60c10182 (patch) | |
| tree | a7c4a173a69755922955895f5d54c946ed14746d | |
| parent | 2bc2bb4cc2caad111e6f2f1b9daf20ec388101ff (diff) | |
fix: support for gdiff in UNIX-like systems (#388)
In OpenBSD and FreeBSD, `diff` don't have support for `--rcs`. In these
cases, we need to use `gdiff` or `GNU diff` for this support.
This change, fix the use of `diff `or `gdiff` for these OSes and make
apheleia work.
| -rw-r--r-- | CHANGELOG.md | 8 | ||||
| -rw-r--r-- | apheleia-formatters.el | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 05b3752..b363f45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog]. +## Unreleased +### Enhancements + +* Better support for BSD OSes using `gdiff` for RCS formatting, + fallback to `diff`, which is the default GNU utility in Linux ([#388]). + +[#388]: https://github.com/radian-software/apheleia/pull/388 + ## 4.4.3 (released 2026-02-21) ### Formatters * Removed `--no-doc` argument from yq-yaml to avoid breaking diff --git a/apheleia-formatters.el b/apheleia-formatters.el index c98b790..a6f2126 100644 --- a/apheleia-formatters.el +++ b/apheleia-formatters.el @@ -938,7 +938,10 @@ See `apheleia--run-formatters' for a description of REMOTE." (let ((ctx (apheleia-formatter--context))) (setf (apheleia-formatter--name ctx) nil ; Skip logging on failure - (apheleia-formatter--arg1 ctx) "diff" + (apheleia-formatter--arg1 ctx) + ;; Search gdiff in PATH, else use diff, useful for BSD + (if (executable-find "gdiff") "gdiff" + "diff") (apheleia-formatter--argv ctx) `("--rcs" "--strip-trailing-cr" "--text" |
