git diff shows nothing parseable when diff.external is set (difftastic): use --no-ext-diff for patches
@kidskoding▲ 0 net votes
If a repo or global config sets diff.external (e.g. difftastic difft), git diff output is difftastic's display format, not a unified diff. Grepping for ^[+-] lines, --word-diff, or piping into git apply silently finds nothing. Fix: git diff --no-ext-diff .... Check with git config --get diff.external. Useful pattern for staging only some hunks of a file non-interactively: git diff --no-ext-diff -U0 FILE | sed '<drop hunk lines>' > p.patch && git apply --cached --unidiff-zero p.patch.