From 06c81a1118a6c9a77505b0ae3092576fa4c01763 Mon Sep 17 00:00:00 2001 From: Abraham Samuel Adekunle Date: Sat, 14 Feb 2026 12:03:54 +0100 Subject: interactive -p: add new `--auto-advance` flag When using the interactive add, reset, stash or checkout machinery, we do not have the option of reworking with a file when selecting hunks, because the session automatically advances to the next file or ends if we have just one file. Introduce the flag `--auto-advance` which auto advances by default, when interactively selecting patches with the '--patch' option. However, the `--no-auto-advance` option does not auto advance, thereby allowing users the option to rework with files. Signed-off-by: Abraham Samuel Adekunle Signed-off-by: Junio C Hamano --- add-interactive.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'add-interactive.c') diff --git a/add-interactive.c b/add-interactive.c index 68fc09547d..ce9e737e0f 100644 --- a/add-interactive.c +++ b/add-interactive.c @@ -64,6 +64,7 @@ void init_add_i_state(struct add_i_state *s, struct repository *r, s->r = r; s->context = -1; s->interhunkcontext = -1; + s->auto_advance = add_p_opt->auto_advance; s->use_color_interactive = check_color_config(r, "color.interactive"); @@ -1017,6 +1018,7 @@ static int run_patch(struct add_i_state *s, const struct pathspec *ps, struct add_p_opt add_p_opt = { .context = s->context, .interhunkcontext = s->interhunkcontext, + .auto_advance = s->auto_advance }; struct strvec args = STRVEC_INIT; struct pathspec ps_selected = { 0 }; -- cgit v1.3-6-g1900