Re: Alternative to manual editing with git add --patch
- From
Sven Helmberger <sven.helmberger@gmx.de>
- Date
- Oct 14, 2015, 23:36 UTC
- Message-ID
- <561EE700.3020002@gmx.de>
- In-Reply-To
- <xmqqk2qp8hlj.fsf@gitster.mtv.corp.google.com>
Am 14.10.2015 um 19:50 schrieb Junio C Hamano:
Show 9 quoted lines
> Sven Helmberger <sven.helmberger@gmx.de> writes: > > As a quick-and-dirty change, you could invent a new variant of > 's'plit that breaks a N-line hunk into N hunks with 1-line each, but > obviously that would not be a pleasant-enough UI to be called usable > when you have a hunk that adds 100 lines. Perhaps "Split this hunk > into two by ending the earlier one immediately before the line that > has this substring" or something might be an idea? >
If we go by the style of interaction in git add --patch and git add --interactive, I think the most canonical solution would be to implement it like this.
If we know when we can't split the current patch any further ( the point at which selecting s changes nothing anymore), why shouldn't add --patch not work similar to add --interactive in that it prints the lines of the diff prefixed with numbers and the user can define a numerical range to "split off". Then they decide whether to add those lines or not and return to the line-numbers until they're trough with the patch.
Regards, Sven Helmberger