]> Kevux Git Server - rit/commit
add-patch: allow interfile navigation when selecting hunks
authorAbraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Sat, 14 Feb 2026 11:06:55 +0000 (12:06 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Feb 2026 18:48:37 +0000 (10:48 -0800)
commit417b181f99ce53f50dea6541430cfe1f1f359a6a
treebd03be33de615da9b805861191aa59440d232b16
parentd3cce5e76fcbce00d33013424bece954f11fa2f3
add-patch: allow interfile navigation when selecting hunks

After deciding on all hunks in a file, the interactive session
advances automatically to the next file if there is another,
or the process ends.

Now using the `--no-auto-advance` flag with `--patch`, the process
does not advance automatically. A user can choose to go to the next
file by pressing '>' or the previous file by pressing '<', before or
after deciding on all hunks in the current file.

After all hunks have been decided in a file, the user can still
rework with the file by applying the options available in the permit
set for that hunk, and after all the decisions, the user presses 'q'
to submit.
After all hunks have been decided, the user can press '?' which will
show the hunk selection summary in the help patch remainder text
including the total hunks, number of hunks marked for use and number
of hunks marked for skip.

This feature is enabled by passing the `--no-auto-advance` flag
to `--patch` option of the subcommands add, stash, reset,
and checkout.

Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-patch.c
t/t3701-add-interactive.sh