summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2023-08-13 23:06:45 -0700
committerWilfred Hughes <me@wilfred.me.uk>2023-08-13 23:08:06 -0700
commitc6be0bc16a95319f210820f0e488e5c9e87d5f6b (patch)
treee8eb8b89e4c5bfef6c883c09712a0afc4b9b3116
parenteeb29749671dc73ae0196a8fcf4a29e17064e57f (diff)
Mention --check-only in the FAQ
-rw-r--r--README.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index 307b678e2..3c241ae0c 100644
--- a/README.md
+++ b/README.md
@@ -96,6 +96,21 @@ showing one way to use difftastic with magit.
Probably not. Difftastic is young. Consider writing a plugin for your
favourite tool, and I will link it in the README!
+### Can I use difftastic to check for syntactic changes without diffing?
+
+Yes. Difftastic can check if the two files have the same AST, without
+calculating a diff. This is much faster than normal diffing, and
+useful for building tools that check for changes.
+
+For example:
+
+```
+$ difft --check-only --exit-code before.js after.js
+```
+
+This will set the exit code to 0 if there are no syntactic changes, or
+1 if there are changes found.
+
## Translation
+ [Chinese](./translation/zh-CN/README-zh-CN.md)