9

I want to be able to use git add -p and have word-level changes highlighted as I inspect each hunk.

This has been a longstanding issue, but I'm still unable to find a solution.

One answer from 2017 suggests using:

git -c interactive.diffFilter="git diff --word-diff" add -p

However, for me this produces an error:

fatal: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.

I can't see why the output of git diff --word-diff would create a mismatch with the needs of git add -p.

In fact, I can even do this:

git -c interactive.diffFilter="git diff" add -p

And I get the same error -- despite the filter being the plain unflagged git diff command itself.

I can only think that lines are being added or removed as part of the filter addition itself, or maybe the paging of git diff (showing as many hunks at once, rather hunk by hunk) is the problem?

guypursey
  • 3,114
  • 3
  • 24
  • 42

0 Answers0