Re: [PATCH v3] git-add--interactive: manual hunk editing mode

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff King
Date: Monday, June 9, 2008 - 1:17 pm

On Mon, Jun 09, 2008 at 07:31:51PM +0200, Johan Herland wrote:


I mean splitting the original "index -> worktree" hunk into two other
hunks, each of which is "index -> worktree" but which can be staged
separately. I.e., what the 's'plit command does, but with finer-grained
control.

But I think that is what you are trying to say...


Yes. I assumed we wanted to maintain the separate splitting operation,
since that parallels the existing split (so the interface is consistent)
and it logically separates the two parts (you split, and then you choose
the part you want).

But honestly, I don't really see a use case that isn't covered by
"manually edit the diff and apply the hunk". And the rationale in your
"side note" indicates that you think the same way.

So now I wonder if we _can_ leverage Dscho's work here. I.e., can we
simply send the edited hunk to "git apply --recount --cached" (instead
of doing a "git apply --check")?

The main problem I see at this point is that it screws up the line
numbering for _every other hunk_, so later hunks in that file might not
apply (IIRC, we usually save up all of the "yes" hunks and apply at the
end). So it might be needed to do a --recount --check, and then actually
apply at the end.

I'll try to play around with that.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] git-add--interactive: manual hunk editing mode, Thomas Rast, (Fri May 23, 1:21 pm)
Re: [PATCH] git-add--interactive: manual hunk editing mode, Johannes Schindelin, (Thu May 29, 9:12 am)
Re: [PATCH] git-add--interactive: manual hunk editing mode, Johannes Schindelin, (Fri May 30, 2:49 am)
Re: [PATCH] git-add--interactive: manual hunk editing mode, Jakub Narebski, (Fri May 30, 3:46 am)
Re: [PATCH] git-add--interactive: manual hunk editing mode, Junio C Hamano, (Fri May 30, 2:35 pm)
Re: [RFC PATCH] git-add--interactive: manual hunk editing ..., Johannes Schindelin, (Thu Jun 5, 3:28 am)
Re: [RFC PATCH] git-add--interactive: manual hunk editing ..., Johannes Schindelin, (Fri Jun 6, 7:31 am)
Re: [RFC PATCH] git-add--interactive: manual hunk editing ..., Johannes Schindelin, (Sun Jun 8, 4:02 pm)
Re: [RFC PATCH] git-add--interactive: manual hunk editing ..., Johannes Schindelin, (Sun Jun 8, 4:06 pm)
Re: [PATCH v3] git-add--interactive: manual hunk editing mode, Johannes Schindelin, (Sun Jun 8, 4:19 pm)
Re: [PATCH v3] git-add--interactive: manual hunk editing mode, Johannes Schindelin, (Mon Jun 9, 9:13 am)
Re: [PATCH v3] git-add--interactive: manual hunk editing mode, Jeff King, (Mon Jun 9, 1:17 pm)
Re: [PATCH v3] git-add--interactive: manual hunk editing mode, Andreas Ericsson, (Tue Jun 10, 4:19 am)
Re: [PATCH v4] git-add--interactive: manual hunk editing mode, Johannes Schindelin, (Mon Jun 23, 11:54 am)
apply --recount, was Re: [PATCH v4] git-add--interactive: ..., Johannes Schindelin, (Mon Jun 23, 2:16 pm)
[PATCH 0/3] Manual editing for 'add' and 'add -p', Thomas Rast, (Tue Jun 24, 12:07 pm)
Re: [PATCH 0/3] Manual editing for 'add' and 'add -p', Miklos Vajna, (Tue Jun 24, 12:53 pm)
Re: [PATCH 1/3] Allow git-apply to ignore the hunk headers ..., Johannes Schindelin, (Fri Jun 27, 10:43 am)