git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: .gitconfig: -c core.pager='less -+F -+X' status
Date: Tue, 21 Mar 2023 20:22:14 +0100	[thread overview]
Message-ID: <6a1bea28-ed50-f32b-35ef-ef12f16e2878@gmail.com> (raw)
In-Reply-To: <20230321184210.GM3119834@coredump.intra.peff.net>


[-- Attachment #1.1: Type: text/plain, Size: 1463 bytes --]

Hi Jeff,

On 3/21/23 19:42, Jeff King wrote:
> 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.

> 
>   $ 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

> 
> 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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2023-03-21 19:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 14:24 .gitconfig: -c core.pager='less -+F -+X' status Alejandro Colomar
2023-03-21 18:42 ` Jeff King
2023-03-21 19:22   ` Alejandro Colomar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a1bea28-ed50-f32b-35ef-ef12f16e2878@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).