From: Junio C Hamano Date: Thu, 23 May 2024 14:00:47 GMT Subject: Re: [PATCH 5/5] add-patch: render hunks through the pager Message-ID: In-Reply-To: <20240523090601.GC1306938@coredump.intra.peff.net> Jeff King writes: > I do still think it > would be useful to be able to configure its pager separately (in my > case, I'd use "less -FX" rather than my default setup, which doesn't use > either of those options). Even better. Allow to optionally have the command after the option, e.g., (1/1) Use this hunk [y,n,q,j,k,e,p,P] P (1/1) Use this hunk [y,n,q,j,k,e,p,P] Pless -FX (1/1) Use this hunk [y,n,q,j,k,e,p,P] Pcat The first one feeds the default program with the hunk via pipe, the second one instead invokes command you specifed, "less -FX", and feeds the hunk to it via a pipe. The last one emulates a plain 'p' behaviour. And for usability, perhaps giving a specific command would change the default program a bare 'P' invokes for the rest of the session until another specific command overrides. Another usability hack may be "[interactive] pipecommand = less -FX" configuration variable gives the initial default for each session. At that point, we can explain it as p - print the current hunk P[] - pipe the current hunk to a program or even use '|' instead of 'P'.