doesn't work on `git am -i`'s `[v]iew patch`
I have delta correctly setup as my git's pager, with interactive options and do on
When running git am -i ..., and in the interactive session choosing [v]iew patch, the current .patch diff should be displayed.
But with delta enabled, that "wrong usage" error shows up instead:
The main way to use delta is to configure it as the pager for git: see https://github.com/dandavison/delta#get-started. You can also use delta to diff two files:
delta file_A file_B.
I only can suppose git does a delta ./file.patch (like a with --no-pager option, the result is the same as simple cat ./file.patch), which indeed trigger that error message.
I can see that piping the file do delta works pretty well, as it just ignores the patch header, and show the diff properly:
> cat ./file.patch
file.patch
From ...
---
.file.txt | 1+
1 file changed ...
diff --git a/file.txt b/file.txt
...
@@ -1,2 +1,3 @@
text file
+ a change
> cat ./file.patch | delta
file.patch
From ...
---
.file.txt | 1+
1 file changed ...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Δ file.txt
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
────────────────┐
• file.txt:1: │
────────────────┘
1 ⋮ 1 │text file
⋮ 2 │a change
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Running manually without the pager (git --no-pager am -i ...), and if needed to see long diffs, do a delta pipe on other terminal, is a somewhat inconvenient workaround, but works for now.
So i suppose it is kinda a feature-request too, to enable delta to read a single .patch file delta file.patch, if it is indeed the workflow going on under the hood here.
Source: dandavison/delta