# [BUG] git help -a should no use page when in pipe

2 messages from 2018-12-11 to 2018-12-11. Participants: 许铖, Junio C Hamano.
Thread: https://gitlist.dev/t/50004

## 许铖, 2018-12-11 06:26

Subject: [BUG] git help -a should no use page when in pipe
Message-ID: <CALmyJ=OaZAgr1i1DXMRQqCVWnKvO=QZH6AeGj8YfKMxAnRz6GA@mail.gmail.com>
URL: https://gitlist.dev/e/CALmyJ%3DOaZAgr1i1DXMRQqCVWnKvO%3DQZH6AeGj8YfKMxAnRz6GA%40mail.gmail.com

```
To whom may concern,

Since git 2.20.0, invoking `git help -a` will cause git using page (e.g. less)
to display help message. However, such behaviour is not desirable when
`git help -a` is run inside a pipe or invoked by another program.

Step to reproduce the bug:
     git help -a | cat # this freezes the command line prompt.

This bug also causes issues in `hub` when invoking `git <alias>`.
More detail can be found at https://github.com/github/hub/issues/1963

I would suggest `git help -a` only invokes page when stdout is a tty.

Thanks for your attention.

Best Regards,
Cheng

```

## Junio C Hamano, 2018-12-11 08:52

Subject: Re: [BUG] git help -a should no use page when in pipe
Message-ID: <xmqqwoogjvil.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqwoogjvil.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <CALmyJ=OaZAgr1i1DXMRQqCVWnKvO=QZH6AeGj8YfKMxAnRz6GA@mail.gmail.com>

```
许铖 <thexuc@gmail.com> writes:

> Since git 2.20.0, invoking `git help -a` will cause git using page (e.g. less)
> to display help message.
> ...
> I would suggest `git help -a` only invokes page when stdout is a tty.


It already does so for me.  "GIT_PAGER=uc git help -a | cat" where
"uc" is a custom "pager" that is "tr '[a-z]' '[A-Z]'" does not show
things in ucase, but without piping to cat, the output is in ucase
as expected.  Perhaps there is something different between what we
are doing.

FWIW, I am not on Windows or on a Mac.

```
