git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: .gitconfig: -c core.pager='less -+F -+X' status

From
ACAlejandro Colomar <alx.manpages@gmail.com>
Date
Mar 21, 2023, 19:22 UTC
Message-ID
<6a1bea28-ed50-f32b-35ef-ef12f16e2878@gmail.com>
In-Reply-To
<20230321184210.GM3119834@coredump.intra.peff.net>
Hi Jeff,
On 3/21/23 19:42, Jeff King wrote:
Show 21 quoted lines
> On Tue, Mar 21, 2023 at 03:24:53PM +0100, Alejandro Colomar wrote:
> 
>> Hi,
>>
>> I wrote recently some aliases to not clutter my screen when I want to
>> check something quick:
>>
>> $ head -n4 ~/.gitconfig 
>> [alias]
>> 	df = -c core.pager='less -+F -+X' diff
>> 	sw = -c core.pager='less -+F -+X' show
>> 	st = -c core.pager='less -+F -+X' status
>>
>> Now, `git df` and `git sw` work as expected: they open a less window,
>> and it's later closed with `q`, with no traces in my screen except for
>> the command itself.  
>>
>> However, `git st` doesn't seem to work.  It prints everything to screen,
>> and then exits.
> 
> git-status doesn't invoke the pager by default:

Ahh, sorry, how could I forget something like that =) Probably some brainfart here between chair and keyboard.

Show 10 quoted lines
> 
>   $ git -c core.pager='echo foo' log
>   foo
> 
>   $ git -c core.pager='echo foo' status
>   On branch [...etc]
> 
> You can configure it to do so:
> 
>   git config --global pager.status true

Hmm, I like this. When status grows hundreds of lines, it's nice if it only shows the first screen by default.

Thanks!
Alex
Show 5 quoted lines
> 
> Or if you just want it to happen in your alias, try:
> 
>   [alias]
>       st = -p -c core.pager='less -+F -+X' status
> 
> -Peff
-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
Previous: Jeff King
Message 3 of 3 in “.gitconfig: -c core.pager='less -+F -+X' status”
  1. Alejandro ColomarMar 21, 2023
  2. Jeff KingMar 21, 2023
  3. Alejandro ColomarMar 21, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.