Re: Autosplit option for git add -p

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On 2024-06-08 12:43, Christian Couder wrote:
On Fri, Jun 7, 2024 at 11:06 AM Konstantin Tokarev <annulen@xxxxxxxxx> wrote:
Is there any option in git to make `git add -p` split hunks by
default, just like 's' was pressed automatically? If no, how would one
implement such an option?

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.

To me, a new command-line option would make more sense.  Though,
perhaps a new configuration option could also make sense when enabled
for particular repositories, but that could also trigger the main red
flag, which is that a repository configuration can change the user
experience, so I'm not sure it wouldn't be frowned upon.

Anyway I think you might want to take a look at the run_add_p()
function in "add-patch.c".

My use case: I've recently started working with big LaTeX document
having every paragraph as a single line. As a result, hunks quickly
become larger than screen, so that splitting is highly desirable.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux