Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow staging and unstaging of hunks via ediff #256

Closed
phil-s opened this Issue · 4 comments

3 participants

phil-s Michael Haggerty Jonas Bernoulli
phil-s

It's great that the staged and unstaged changes can be viewed in ediff, but it would be brilliant if you could actually use ediff to make those selections in the first place.

Michael Haggerty

:+1: This would be awesome!

I use magit occasionally, but I usually revert back to the command line the first time I want to do the equivalent of "git add -p" followed by "e" ("edit this hunk"). Being able to use ediff to select what to stage would be really powerful.

I learned today that part of a hunk can be highlighted and staged--a nice feature, but still not as powerful as being able to edit a few characters within a line of a diff.

Jonas Bernoulli
Owner

Please see #1261.

Jonas Bernoulli tarsius closed this
Jonas Bernoulli tarsius added the . label
Jonas Bernoulli tarsius removed the . label
Jonas Bernoulli tarsius referenced this issue from a commit
Jonas Bernoulli tarsius magit-ediff-resolve-file: new command
Add `magit-ediff-resolve-file', a simple wrapper around `smerge-ediff',
as a replacement for `magit-interactive-resolve'.  This fixes #256, i.e.
only unresolved commits are shown.  Ediff was created in the age of vcs
that are bad at merging and has not yet been adjusted for dvcs like Git
and Mercurial, and so it actually wants to do all everything that needs
to be done to do a merge.  However we want to initiate the merge using
Git and then we want Ediff to help us with the conflicts Git could not
automatically resolve; we don't want to also have Ediff attempt to
resolve the conflicts that Git already resolved, especially because
Ediff fails more often than Git, causing the user additional work.
That's why the command name contains "resolve" not "merge", we only
use Ediff to resolve conflicts, not to do a merge.
a483a9a
Jonas Bernoulli tarsius referenced this issue from a commit
Jonas Bernoulli tarsius magit-ediff-resolve-file: new command
Add `magit-ediff-resolve-file', a simple wrapper around `smerge-ediff',
as a replacement for `magit-interactive-resolve'.  This fixes #256, i.e.
only unresolved commits are shown.  Ediff was created in the age of vcs
that are bad at merging and has not yet been adjusted for dvcs like Git
and Mercurial, and so it actually wants to do all everything that needs
to be done to do a merge.  However we want to initiate the merge using
Git and then we want Ediff to help us with the conflicts Git could not
automatically resolve; we don't want to also have Ediff attempt to
resolve the conflicts that Git already resolved, especially because
Ediff fails more often than Git, causing the user additional work.
That's why the command name contains "resolve" not "merge", we only
use Ediff to resolve conflicts, not to do a merge.
9f0bc80
Jonas Bernoulli tarsius added 30 support and removed 02 old ediff labels
Jonas Bernoulli
Owner

Magit has actually supported this for some time now. To some extend - I never used it so I don't quite know how well it works.

I have just merged a new implementation into the next branch (see #1429), and this version works pretty well. The command is magit-ediff-stage but you can also use magit-ediff-dwim when staging is the most logical next step.

Michael Haggerty

That's awesome! I'm on vacation now, but I will try it when I am back home.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.