[PATCH v4 0/4] introduce new option `--auto-advance`
- From
Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
- Date
- Feb 13, 2026, 22:08 UTC
- Message-ID
- <cover.1771015581.git.abrahamadekunle50@gmail.com>
- In-Reply-To
- <cover.1770390576.git.abrahamadekunle50@gmail.com>
Hello,
After after more reviews and deliberations, I have been able to rename the new option name to `--auto-advance`, where the --no-auto-advance implements the feature and does not auto advance while --auto-advance is the default and maintains the current behaviour.
With the option, users can navigate in between files while deciding on hunks as they wish with the '>' and '<' option for going to the next and previous file respectively if there are more than one file.
Patch 1 implements the new `--no-auto-advance` options, Patch 2 modifies the function `patch_update_file()` to instead take the index of the file as parameter instead of the file_diff. Patch 3 moves the 'git apply' logic into a function so that we can reuse this logic when implementing the all or none application of patches. Patch 4 implements the interfile navigation, and adds tests to the interactive test file.
Changes in v4: ============== - Renamed option to `--no-auto-advance` with `auto-advance` being the default option - Modified the function signature of 'patch_update_file()' to accept the index of the file diff - Moved git apply logic into function for reuse - Removed the whatnow prompt. Now the hunks in the file keep showing even after all hunks have been decided - Added hunk summary to patch help remainder to show the user the hunk deails - Added tests ot t3701-add-interactive.sh
Abraham Samuel Adekunle (4): interactive -p: add new `--auto-advance` flag add-patch: modify patch_update_file() signature add-patch: allow all-or-none application of patches add-patch: allow interfile navigation when selecting hunks
add-interactive.c | 4 + add-interactive.h | 5 +- add-patch.c | 157 +++++++++++++++++++++++++++---------- builtin/add.c | 4 + builtin/checkout.c | 7 ++ builtin/reset.c | 4 + builtin/stash.c | 8 ++ t/t3701-add-interactive.sh | 100 +++++++++++++++++++++++ t/t9902-completion.sh | 1 + 9 files changed, 246 insertions(+), 44 deletions(-)
-- 2.39.5 (Apple Git-154)