Thread (2 messages) flat view 2 messages, 2 authors, 2026-02-12

Re: [PATCH v3 2/3] add-patch: Allow interfile navigation when selecting hunks

From: Junio C Hamano <hidden>
Date: 2026-02-12 21:31:53

Samuel Abraham [off-list ref] writes:
quoted
There was a separate topic that added "(was: [yn])" to the prompt
when the prompt asks about a hunk that already has been decided on.
As we only need a single bit "all hunks decided", can we do
something similar, I wonder?  At the beginning of the main prompt,
we show which of the N available hunks we are currently at, e.g.,

 (1/2) Stage this hunk (was: y) [y,n,q,a,d,k,K,j,J,g,/,e,p,P,?]?

Perhaps we can add a third number to indicate how many of the
available hunks the user has already decided, or something, that can
be used to avoid this wasted line?  Or is it a good thing that we
are loud in this case using a whole line to remind the user that it
may be time to move on?  I dunno.
I thought of a suggestion where after deciding on all hunks in the
file, the user
will be able to see the "what now prompt", the options for the current hunk and
also the previous decision on the hunk since at this point, all the
hunks would have been decided on.

I tried something like

What now? (was: n) [y,n,q,a,d,s,e,>,<,p,P,?]?

This does not show the number of the hunk we are currently at and the
"Stage this hunk" since the decision had been made initially but the "whatnow"
prompt still provides a chance to change the decision, while showing
the previous
decision on the hunk by asking "What now?" instead.
The options have the default [y,n,q,a,d] and the remaining options are populated
from the permit set for the hunk. SO the user can still carry out the
normal actions on
the hunk.
I like the compactness of that myself, but I have to say that the
end-users may feel lost and utterly confused with the distinction,
if they are left without being explained why we switch between
"Stage this" (which by the way changes phrasing depending on what
you are doing) and "What now".

Is it so important to indicate that everything in the hunk has been
decided?  They'd lose 'j' 'k' when there no longer remains undecided
ones, and every hunk they revisit with 'J' or 'K' would say (was: X),
which may be a clue enough that they are done with the file, and
when they really really wanted to make sure, perhaps they can type
'?' and that help can spend a line to say "Out of 8 hunks, you have
already decided to use 3 hunks, and skip 5 hunks" or something?

I dunno.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help