git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Konstantin Tokarev <annulen@yandex.ru>,  git@vger.kernel.org
Subject: Re: Autosplit option for git add -p
Date: Sat, 08 Jun 2024 11:53:33 -0700	[thread overview]
Message-ID: <xmqqmsnvclle.fsf@gitster.g> (raw)
In-Reply-To: <CAP8UFD3JM_h1BvK59R4wT1DeZyo6o-9T3GXGK8xE6vLnDMDCaQ@mail.gmail.com> (Christian Couder's message of "Sat, 8 Jun 2024 12:43:33 +0200")

Christian Couder <christian.couder@gmail.com> 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).



      parent reply	other threads:[~2024-06-08 18:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07  9:05 Autosplit option for git add -p Konstantin Tokarev
2024-06-08 10:43 ` Christian Couder
2024-06-08 10:47   ` Dragan Simic
2024-06-08 18:53   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmsnvclle.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=annulen@yandex.ru \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).