{"thread":{"id":"50004","subject":"[BUG] git help -a should no use page when in pipe","startedAt":"2018-12-11T06:26:55Z","lastAt":"2018-12-11T08:52:07Z","messageCount":2,"participants":["许铖","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"365042","messageId":"CALmyJ=OaZAgr1i1DXMRQqCVWnKvO=QZH6AeGj8YfKMxAnRz6GA@mail.gmail.com","threadId":"50004","inReplyTo":null,"subject":"[BUG] git help -a should no use page when in pipe","fromName":"许铖","fromEmail":"thexuc@gmail.com","sentAt":"2018-12-11T06:26:42Z","receivedAt":"2018-12-11T06:26:55Z","isPatch":false,"sender":{"key":"thexuc@gmail.com","avatar":null},"body":"To whom may concern,\n\nSince git 2.20.0, invoking `git help -a` will cause git using page (e.g. less)\nto display help message. However, such behaviour is not desirable when\n`git help -a` is run inside a pipe or invoked by another program.\n\nStep to reproduce the bug:\n     git help -a | cat # this freezes the command line prompt.\n\nThis bug also causes issues in `hub` when invoking `git <alias>`.\nMore detail can be found at https://github.com/github/hub/issues/1963\n\nI would suggest `git help -a` only invokes page when stdout is a tty.\n\nThanks for your attention.\n\nBest Regards,\nCheng\n"},{"id":"365046","messageId":"xmqqwoogjvil.fsf@gitster-ct.c.googlers.com","threadId":"50004","inReplyTo":"CALmyJ=OaZAgr1i1DXMRQqCVWnKvO=QZH6AeGj8YfKMxAnRz6GA@mail.gmail.com","subject":"Re: [BUG] git help -a should no use page when in pipe","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-12-11T08:52:02Z","receivedAt":"2018-12-11T08:52:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"许铖 <thexuc@gmail.com> writes:\n\n> Since git 2.20.0, invoking `git help -a` will cause git using page (e.g. less)\n> to display help message.\n> ...\n> I would suggest `git help -a` only invokes page when stdout is a tty.\n\n\nIt already does so for me.  \"GIT_PAGER=uc git help -a | cat\" where\n\"uc\" is a custom \"pager\" that is \"tr '[a-z]' '[A-Z]'\" does not show\nthings in ucase, but without piping to cat, the output is in ucase\nas expected.  Perhaps there is something different between what we\nare doing.\n\nFWIW, I am not on Windows or on a Mac.\n"}]}