Subject: Re: Autosplit option for git add -p

From: Junio C Hamano <[email-masked]>
Date: Sat, 08 Jun 2024 11:53:33 -0700

Christian Couder <[email-masked]> writes:

> It doesn't look like there is any option to do that. About
> implementing it, it depends if it would be a command line option or a
> config option.

Having these alone make no sense to me.

I'd suggest extending the lowest level (i.e. interactive prompt
response) first so that a stronger 's' splits all hunks in the
current file.  It might be sufficient for the use case.

On top of that, it happens to be that when changes to _all_ paths
want to be split, it may prove handy to also have a command line
option.

But the reason why I am hesitant to endorse a command line option
that splits everything is because:

 (1) it is dubious to expect the user to _know_ that it makes sense
     to split all changes before starting "add -p" (and friends).

 (2) if the user gives such an option and then in the interactive
     session regrets that it was too much to split all the hunks, it
     is unclear how the user can easily recover (there is no "merge
     all hunks back to the original" operation).