How do you stage a hunk into git from ediff?
I'd like to be able to view a side-by-side diff and stage hunks into the "HEAD" side of the diff, but that buffer (i.e., spacemacs.~master~
) is read-only. Ideally, I could also edit that staged file (to achieve the precision I'd get from editing a hunk from git command-line).
It looks like I can invoke magit status (M-x magit-status
), expand a diff (TAB
), and use s
to stage a diff hunk, but I'd like to do this on a file-by-file basis and from a side-by-side diff.
I'm hoping to replicate the behavior of vim-fugitive.
magit-status
, select the relevant part you want to split and presss
.magit
then only stages the selected region and leaving the rest out. You can create a commit out of it then repeat for the remaining part.TAB
to expand a diff,V
to select a line in the hunk, ands
to stage, I getevil-change: Buffer is read-only: #<buffer *magit: emacs.d*>
. If I comment out my visual modes
binding and try again, then emacs is waiting for another key (I sees-
at the bottom). PressingS
gives me the same read-only error.develop
branch. See this issue.