Re: [RFC PATCH] git-add--interactive: manual hunk editing mode v2
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 8, 2008, 23:06 UTC
- Message-ID
- <alpine.DEB.1.00.0806090003450.1783@racer>
- In-Reply-To
- <200806090033.51167.trast@student.ethz.ch>
Hi,
On Mon, 9 Jun 2008, Thomas Rast wrote:
Show 19 quoted lines
> Jeff King wrote: > > > > I wrote this after reading just your first patch, and it looks like > > you've made much progress since. It seems like Thomas' patch could > > just get rid of all the recounting entirely, and just pass off the > > edited hunks to "git apply --recount". Which should make his patch > > much smaller and more straightforward. > > I think there's no way to split hunks, in the way I currently "help" > with @@ line guessing, using just the --recount feature. Unless the > editor helps you with adding complete correct @@ lines in the middle of > hunks (Emacs does that). I don't think it is at all possible to remove > the middle part of a hunk in Johannes' scheme without somehow figuring > out the corresponding @@ line (or at least its old line number) or > editing away every +/- line. > > Then again it's not always easy even with my patch: you may have to > manually insert extra context because of the rule against zero lines > of context.
That is actually where Junio convinced me that my approach is wrong: he said that you can _only_ reliably split a hunk at common lines.
The thing is: if you split _not_ at a common line, the context of the second part would _change_ depending if you want to apply the first part or not.
Ciao, Dscho