Re: [PATCH v3 2/3] add-patch: Allow interfile navigation when selecting hunks
- From
Samuel Abraham <abrahamadekunle50@gmail.com>
- Date
- Feb 12, 2026, 22:20 UTC
- Message-ID
- <CADYq+fZ3b-bEBt_7B-KvGi9vyCOc6=pxVgx+Wbod-TM4oMaKog@mail.gmail.com>
- In-Reply-To
- <xmqqh5rlmywp.fsf@gitster.g>
On Thu, Feb 12, 2026 at 10:31 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 42 quoted lines
> > Samuel Abraham <abrahamadekunle50@gmail.com> writes: > > >> 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".
Yes I agree.
Show 10 quoted lines
> > 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.
Yes I also think this works. It is not so important to indicate that everything has been decided. The (was: X) shows that the hunk has been decided on and it should be enough. I will add the information to the help_patch section. Thanks
Abraham