git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Request: git add --interactive: split hunk: When can't split further, split on empty lines
@ 2019-05-30  0:19 James Harvey
  2019-05-30 14:53 ` Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: James Harvey @ 2019-05-30  0:19 UTC (permalink / raw)
  To: git, gitster

When adding interactively, 's' can be used to split the current hunk.
Once it gets down to where 's' reports "Sorry, cannot split this
hunk", it could be useful if it would then start splitting based on
empty lines, probably leaving empty lines at the top of the split
hunks.  It certainly wouldn't be perfect, and might create many hunks,
but it would be a nice alternative to manually editing the hunk.
Certainly someone could still manually edit the hunk if they didn't
want to use it in a particular situation.

Example:

----------
int a() {
}

int b() {
}
----------

becomes

---------
int a() {
}
---------

int b() {
}
---------

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-30 20:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-30  0:19 Request: git add --interactive: split hunk: When can't split further, split on empty lines James Harvey
2019-05-30 14:53 ` Johannes Schindelin
2019-05-30 19:26   ` Philip Oakley
2019-05-30 19:43     ` Johannes Schindelin
2019-05-30 20:30       ` Philip Oakley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).