You mean, the hunk header with the @@ and the line numbers? If so, then no, but then I use Emacs’s diff-editing mode, which automatically keeps hunk headers correct as you edit. However, I’ve just tried env EDITOR=vim git add -p, and edited a patch in a way that changes the number of lines added and removed, and Git seems to have handled it fine.
(Sorry to nitpick the terminology, but I think that’s what you mean, and for diffs, “context” usually means the space-prefixed lines that show surrounding unchanged code, and that can be used to apply patches even when the line numbers match only fuzzily.)
Re: I use add -p all the time...
You mean, the hunk header with the
@@
and the line numbers? If so, then no, but then I use Emacs’s diff-editing mode, which automatically keeps hunk headers correct as you edit. However, I’ve just triedenv EDITOR=vim git add -p
, and edited a patch in a way that changes the number of lines added and removed, and Git seems to have handled it fine.(Sorry to nitpick the terminology, but I think that’s what you mean, and for diffs, “context” usually means the space-prefixed lines that show surrounding unchanged code, and that can be used to apply patches even when the line numbers match only fuzzily.)