{"thread":{"id":"33992","subject":"Should \"git help\" respect the 'pager' setting?","startedAt":"2013-05-30T16:33:01Z","lastAt":"2013-06-02T22:24:09Z","messageCount":7,"participants":["Michael Campbell","Matthieu Moy","Ramkumar Ramachandra","John Keeping","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"219028","messageId":"CAKtB=OCyoN8ECYiAzXc3UiCrLfWn7Pq7_5CSQUjJ2dhbzQ2RsQ@mail.gmail.com","threadId":"33992","inReplyTo":null,"subject":"Should \"git help\" respect the 'pager' setting?","fromName":"Michael Campbell","fromEmail":"michael.campbell@gmail.com","sentAt":"2013-05-30T16:33:01Z","receivedAt":"2013-05-30T16:33:01Z","isPatch":false,"sender":{"key":"michael.campbell@gmail.com","avatar":null},"body":"I have my global git config pager set to 'cat', but when I do a \"git\nhelp <command>\", it still uses a pager.  This is especially irksome in\nemacs shell buffers, where I am most of the time.  I know I can do a\nM-x man -> git-<whatever>, but wondered if this was a bug or user\nerror.  (\"git --no-pager help <command>\" does the same.)\n\n\n12:31 [mcampbell] /tmp  % git --no-pager help log\nWARNING: terminal is not fully functional\n-  (press RETURN)\n"},{"id":"219030","messageId":"vpqtxlko1vn.fsf@anie.imag.fr","threadId":"33992","inReplyTo":"CAKtB=OCyoN8ECYiAzXc3UiCrLfWn7Pq7_5CSQUjJ2dhbzQ2RsQ@mail.gmail.com","subject":"Re: Should \"git help\" respect the 'pager' setting?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-05-30T16:42:36Z","receivedAt":"2013-05-30T16:42:36Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Michael Campbell <michael.campbell@gmail.com> writes:\n\n> I have my global git config pager set to 'cat', but when I do a \"git\n> help <command>\", it still uses a pager.  This is especially irksome in\n> emacs shell buffers, where I am most of the time.  I know I can do a\n> M-x man -> git-<whatever>, but wondered if this was a bug or user\n> error.  (\"git --no-pager help <command>\" does the same.)\n\n\"git help foo\" just calls \"man git-foo\" by default, so what happens is\nthe same as if you called \"man git-foo\" by hand. Git does not have\nmuch control over what man will do, it could probably call \"man -P\n$pager\" when the Git pager is set, but I'd find it a bit weird.\n\nIf you're an Emacs user, you can read about man.viewer and set it to\nwoman, or set PAGER=cat when inside Emacs.\n\nI personally run M-x git-foo RET, and never run \"git help\".\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"219032","messageId":"CALkWK0=RUy6=4k9uGpy2efdL8DhOnNO52rHZWSmHP3C=2a4SUw@mail.gmail.com","threadId":"33992","inReplyTo":"vpqtxlko1vn.fsf@anie.imag.fr","subject":"Re: Should \"git help\" respect the 'pager' setting?","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-30T16:56:36Z","receivedAt":"2013-05-30T16:56:36Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Matthieu Moy wrote:\n> Michael Campbell <michael.campbell@gmail.com> writes:\n>> I have my global git config pager set to 'cat', but when I do a \"git\n>> help <command>\", it still uses a pager.  This is especially irksome in\n>> emacs shell buffers, where I am most of the time.  I know I can do a\n>> M-x man -> git-<whatever>, but wondered if this was a bug or user\n>> error.  (\"git --no-pager help <command>\" does the same.)\n>\n> \"git help foo\" just calls \"man git-foo\" by default, so what happens is\n> the same as if you called \"man git-foo\" by hand. Git does not have\n> much control over what man will do, it could probably call \"man -P\n> $pager\" when the Git pager is set, but I'd find it a bit weird.\n\nIt just needs to set $PAGER or $MANPAGER before the exec(), no?  I\nwould argue that it should do this.  $GIT_PAGER works everywhere else,\nbut obviously man has no knowledge about it.\n\n> If you're an Emacs user, you can read about man.viewer and set it to\n> woman, or set PAGER=cat when inside Emacs.\n\nI just learnt about man.viewer.  There's a small problem with it\nthough: why is there no option for Emacs man corresponding to Emacs\nwoman?\n\n> I personally run M-x git-foo RET, and never run \"git help\".\n\nM-x man git-foo RET, you mean?  My style is slightly different: I love\ntyping out 'man git log' on the terminal (dashless); I get it to open\nin an Emacs buffer using this hack:\n\nfunction man_ () {\n\temacsclient -e \"(man \\\"$*\\\")\" 2>&1 >/dev/null || man \"$*\"\n}\n\nalias man=man_\n"},{"id":"219033","messageId":"vpqhahko0ub.fsf@anie.imag.fr","threadId":"33992","inReplyTo":"CALkWK0=RUy6=4k9uGpy2efdL8DhOnNO52rHZWSmHP3C=2a4SUw@mail.gmail.com","subject":"Re: Should \"git help\" respect the 'pager' setting?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-05-30T17:05:00Z","receivedAt":"2013-05-30T17:05:00Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> It just needs to set $PAGER or $MANPAGER before the exec(), no?\n\nYes, that should do the same as \"man -P\".\n\n> I would argue that it should do this. $GIT_PAGER works everywhere\n> else, but obviously man has no knowledge about it.\n\nI find it a bit weird that Git sets the configuration for external\ncommands, but it may make sense. No strong opinion here.\n\n>> If you're an Emacs user, you can read about man.viewer and set it to\n>> woman, or set PAGER=cat when inside Emacs.\n>\n> I just learnt about man.viewer.  There's a small problem with it\n> though: why is there no option for Emacs man corresponding to Emacs\n> woman?\n\nI guess because no one implemented it ;-).\n\n>> I personally run M-x git-foo RET, and never run \"git help\".\n>\n> M-x man git-foo RET, you mean?\n\nYes, sorry.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"219034","messageId":"CALkWK0ns3iVATnPwZ4OFJUxefyE6j-ayV3-iwh3Wr9FBZJyt1g@mail.gmail.com","threadId":"33992","inReplyTo":"vpqhahko0ub.fsf@anie.imag.fr","subject":"Re: Should \"git help\" respect the 'pager' setting?","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-30T17:08:59Z","receivedAt":"2013-05-30T17:08:59Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Matthieu Moy wrote:\n> I find it a bit weird that Git sets the configuration for external\n> commands, but it may make sense. No strong opinion here.\n\nI don't mean a setenv() kind of thing: how would we unset it after\nthat?  Perhaps something like execvpe(), passing in the environment as\nan argument?\n"},{"id":"219035","messageId":"20130530171431.GF17475@serenity.lan","threadId":"33992","inReplyTo":"CALkWK0ns3iVATnPwZ4OFJUxefyE6j-ayV3-iwh3Wr9FBZJyt1g@mail.gmail.com","subject":"Re: Should \"git help\" respect the 'pager' setting?","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-05-30T17:14:31Z","receivedAt":"2013-05-30T17:14:31Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Thu, May 30, 2013 at 10:38:59PM +0530, Ramkumar Ramachandra wrote:\n> Matthieu Moy wrote:\n> > I find it a bit weird that Git sets the configuration for external\n> > commands, but it may make sense. No strong opinion here.\n> \n> I don't mean a setenv() kind of thing: how would we unset it after\n> that?  Perhaps something like execvpe(), passing in the environment as\n> an argument?\n\nOverriding PAGER might make sense, but I'd be quite annoyed if Git\ndecided to override MANPAGER without providing some way to override it.\n\nIf a user sets MANPAGER then it's because they want a specific pager\nwhen reading man pages - invoking man through \"git help\" shouldn't cause\nit to behave differently in this case.\n"},{"id":"219196","messageId":"7va9n8m9rq.fsf@alter.siamese.dyndns.org","threadId":"33992","inReplyTo":"20130530171431.GF17475@serenity.lan","subject":"Re: Should \"git help\" respect the 'pager' setting?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-02T22:24:09Z","receivedAt":"2013-06-02T22:24:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Keeping <john@keeping.me.uk> writes:\n\n> On Thu, May 30, 2013 at 10:38:59PM +0530, Ramkumar Ramachandra wrote:\n>> Matthieu Moy wrote:\n>> > I find it a bit weird that Git sets the configuration for external\n>> > commands, but it may make sense. No strong opinion here.\n>> \n>> I don't mean a setenv() kind of thing: how would we unset it after\n>> that?  Perhaps something like execvpe(), passing in the environment as\n>> an argument?\n\nRunning \"man\" is the last thing we do before exitting \"git help\" and\nexec_man_man() does seem to do execlp(), so I do not see it as an\nissue.\n\n> Overriding PAGER might make sense, but I'd be quite annoyed if Git\n> decided to override MANPAGER without providing some way to override it.\n\nHmm, see below.\n\n> If a user sets MANPAGER then it's because they want a specific pager\n> when reading man pages - invoking man through \"git help\" shouldn't cause\n> it to behave differently in this case.\n\nTrue, and for that matter, if the user sets PAGER to use with\nnon-Git (including manual pages) and also sets GIT_PAGER to use\nspecifically with Git, the user would be annoyed if we passed\nformatted manual pages to GIT_PAGER by exporting PAGER (or driving\n\"man\" with its \"-P\" option).\n"}]}