{"thread":{"id":"16669","subject":"fatal output from git-show really wants a terminal","startedAt":"2008-12-10T16:01:49Z","lastAt":"2008-12-15T08:25:15Z","messageCount":13,"participants":["Tim Olsen","Boyd Stephen Smith Jr.","Johannes Sixt","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"97495","messageId":"ghop5d$qud$1@ger.gmane.org","threadId":"16669","inReplyTo":null,"subject":"fatal output from git-show really wants a terminal","fromName":"Tim Olsen","fromEmail":"tim@brooklynpenguin.com","sentAt":"2008-12-10T16:01:49Z","receivedAt":"2008-12-10T16:01:49Z","isPatch":false,"sender":{"key":"tim@brooklynpenguin.com","avatar":"https://gravatar.com/avatar/a468fd97b6433c4d22252ca75017d30a55046f5715e67b83e62b00a0833deb22?d=mp&s=160"},"body":"It appears that when outputting a fatal error, git-show will choose\nstdout over stderr if stdout is a terminal and stderr is not.  How do I\nredirect the error but still allow stdout to be displayed?\n\n~/git$ mkdir test\n\n~/git$ cd test\n\n~/git/test$ git init\n\n~/git/test$ git show 12345\n\nfatal: ambiguous argument '12345': unknown revision or path not in the\nworking tree.\nUse '--' to separate paths from revisions\n\n~/git/test$ git show 12345 2> /dev/null\n\nfatal: ambiguous argument '12345': unknown revision or path not in the\nworking tree.\nUse '--' to separate paths from revisions\n\n~/git/test$ git show 12345 > /dev/null\n\nfatal: ambiguous argument '12345': unknown revision or path not in the\nworking tree.\nUse '--' to separate paths from revisions\n\n~/git/test$ git show 12345 > /dev/null 2> /dev/null\n\n~/git/test$ git show 12345 > /tmp/out 2> /tmp/err\n\n~/git/test$ cat /tmp/out\n\n~/git/test$ cat /tmp/err\n\nfatal: ambiguous argument '12345': unknown revision or path not in the\nworking tree.\nUse '--' to separate paths from revisions\n"},{"id":"97496","messageId":"200812101010.14868.bss03@volumehost.net","threadId":"16669","inReplyTo":"ghop5d$qud$1@ger.gmane.org","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss03@volumehost.net","sentAt":"2008-12-10T16:10:14Z","receivedAt":"2008-12-10T16:10:14Z","isPatch":false,"sender":{"key":"bss03@volumehost.net","avatar":"https://gravatar.com/avatar/74fa10b37dfd44462a6a30c4d4e3bda26ab7991ddb0d8ab24b022714a8ecb918?d=mp&s=160"},"body":"On Wednesday 2008 December 10 10:01:49 you wrote:\n>It appears that when outputting a fatal error, git-show will choose\n>stdout over stderr if stdout is a terminal and stderr is not.  How do I\n>redirect the error but still allow stdout to be displayed?\n\nGah, I think that's really bad behavior. Anyway, something like:\ngit show 12345 2>/dev/null | cat\nshould work.  Neither stdout nor stderr will be a terminal, but stdout will be \ndisplayed to your terminal.\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss03@volumehost.net                      ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.org/                      \\_/     \n"},{"id":"97507","messageId":"200812102046.50186.j6t@kdbg.org","threadId":"16669","inReplyTo":"ghop5d$qud$1@ger.gmane.org","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2008-12-10T19:46:50Z","receivedAt":"2008-12-10T19:46:50Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Mittwoch, 10. Dezember 2008, Tim Olsen wrote:\n> It appears that when outputting a fatal error, git-show will choose\n> stdout over stderr if stdout is a terminal and stderr is not.\n\nThis is by design.\n\n> How do I \n> redirect the error but still allow stdout to be displayed?\n\n$ git show 12345 2> /dev/null | less\n\n> ~/git$ mkdir test\n> ~/git$ cd test\n> ~/git/test$ git init\n> ~/git/test$ git show 12345\n> fatal: ambiguous argument '12345': unknown revision or path not in the\n> working tree.\n> Use '--' to separate paths from revisions\n\nYou see this through the pager.\n\n> ~/git/test$ git show 12345 2> /dev/null\n> fatal: ambiguous argument '12345': unknown revision or path not in the\n> working tree.\n> Use '--' to separate paths from revisions\n\nAnd this went through the pager as well.\n\n> ~/git/test$ git show 12345 > /dev/null\n> fatal: ambiguous argument '12345': unknown revision or path not in the\n> working tree.\n> Use '--' to separate paths from revisions\n\nThis went straight to the terminal.\n\nThe pattern is that if stdout is a terminal, the pager is thrown up and both \nstdout and stderr of git show proper are redirected to the pager. If you \nredirect only stderr, then this redirection is actually ignored.\n\n-- Hannes\n"},{"id":"97511","messageId":"4940224D.9060607@brooklynpenguin.com","threadId":"16669","inReplyTo":"200812102046.50186.j6t@kdbg.org","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Tim Olsen","fromEmail":"tim@brooklynpenguin.com","sentAt":"2008-12-10T20:10:53Z","receivedAt":"2008-12-10T20:10:53Z","isPatch":false,"sender":{"key":"tim@brooklynpenguin.com","avatar":"https://gravatar.com/avatar/a468fd97b6433c4d22252ca75017d30a55046f5715e67b83e62b00a0833deb22?d=mp&s=160"},"body":"Johannes Sixt wrote:\n> The pattern is that if stdout is a terminal, the pager is thrown up and both \n> stdout and stderr of git show proper are redirected to the pager. If you \n> redirect only stderr, then this redirection is actually ignored.\n\nI see.  So I probably want to use --no-pager.\n\nThanks for the help.\n\n-Tim\n\n> \n> -- Hannes\n"},{"id":"97531","messageId":"200812101624.11255.bss03@volumehost.net","threadId":"16669","inReplyTo":"200812102046.50186.j6t@kdbg.org","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss03@volumehost.net","sentAt":"2008-12-10T22:24:06Z","receivedAt":"2008-12-10T22:24:06Z","isPatch":false,"sender":{"key":"bss03@volumehost.net","avatar":"https://gravatar.com/avatar/74fa10b37dfd44462a6a30c4d4e3bda26ab7991ddb0d8ab24b022714a8ecb918?d=mp&s=160"},"body":"On Wednesday 2008 December 10 13:46:50 you wrote:\n>On Mittwoch, 10. Dezember 2008, Tim Olsen wrote:\n>> It appears that when outputting a fatal error, git-show will choose\n>> stdout over stderr if stdout is a terminal and stderr is not.\n>\n>This is by design.\n\nThen it is poor design. :P j/k\n\nWhy not use the pager only if git-show is \"interactive\", using the same test \nfor interactivity as SUSv3/POSIX shells use?  IIRC, a shell is interactive if \nboth stdin and stderr are terminals.  That test for interactivity -- a \nassociated difference in behavior -- predates git by a number of years.  Is \nthere a reason for being different?  Is the porcelain consistent about that \nbehavior?\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss03@volumehost.net                      ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.org/                      \\_/     \n"},{"id":"97602","messageId":"200812111051.20322.bss03@volumehost.net","threadId":"16669","inReplyTo":"alpine.DEB.1.00.0812111015140.18321@eeepc-johanness","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss03@volumehost.net","sentAt":"2008-12-11T16:51:15Z","receivedAt":"2008-12-11T16:51:15Z","isPatch":false,"sender":{"key":"bss03@volumehost.net","avatar":"https://gravatar.com/avatar/74fa10b37dfd44462a6a30c4d4e3bda26ab7991ddb0d8ab24b022714a8ecb918?d=mp&s=160"},"body":"On Thursday 2008 December 11 03:15:47 you wrote:\n>On Wed, 10 Dec 2008, Boyd Stephen Smith Jr. wrote:\n>> On Wednesday 2008 December 10 13:46:50 you wrote:\n>> >On Mittwoch, 10. Dezember 2008, Tim Olsen wrote:\n>> >> It appears that when outputting a fatal error, git-show will choose\n>> >> stdout over stderr if stdout is a terminal and stderr is not.\n>> >\n>> >This is by design.\n>>\n>> Then it is poor design. :P j/k\n>\n>Read up on the reasoning before trolling, will ya?  It's all in the Git\n>history.\n\nSeeing how I'm new, and this message indicated I had screwed up, I starting \ngoing through the 'git log' looking for a commit message that either \ndocumented this behavior, or indicated the commit had documented this \nbehavior.\n\nInitially, I was looking for 'stdout' or 'stderr', and found many unrelated \ncommits.  I then figured it was part of the PAGER support, and began \nsearching for that.  I did find an indication of why stdout and stderr are \nboth redirected to the PAGER's stdin -- but that makes sense to me; I wasn't \nquestioning it.  At least not too much -- but when the user indicates stderr \nand stdout should go to different locations, shouldn't they?\n\nI was mainly questioning using a pager AT ALL when the git command is used in \na non-interactive environment, and how git detects an interactive invocation.  \nI feel this should be done the same way a (POSIX standard) shell detects \ninteractivity, and that in a non-interactive environment git should not \ndefault to using PAGER.\n\nNow, I certainly could have missed the commit message / commit with \nrationale / documentation.  'git log' output is a long document, and I maybe \nusing the wrong keywords for my search.  It also is not all the documentation \nthat is out there.  I'm not afraid to RTFM; but I'm not having much luck \nfinding the right parts to R.\n\nFinally, I didn't mean to offend.  I was hoping the smiley (\":P\") and \"j/k\" \nwould indicate that a was only half serious and know that I don't have the \nbenefit of following the project closely for very long.  I'm appreciative of \nthe hard work that goes into git and don't mean to belittle that effort.\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss03@volumehost.net                      ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.org/                      \\_/     \n"},{"id":"97626","messageId":"20081211215554.GA11565@sigill.intra.peff.net","threadId":"16669","inReplyTo":"200812111051.20322.bss03@volumehost.net","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-12-11T21:55:55Z","receivedAt":"2008-12-11T21:55:55Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Dec 11, 2008 at 10:51:15AM -0600, Boyd Stephen Smith Jr. wrote:\n\n> Initially, I was looking for 'stdout' or 'stderr', and found many unrelated \n> commits.  I then figured it was part of the PAGER support, and began \n\nTry looking for isatty, which takes the numeric fd. I think the behavior\nyou asked about would be this:\n\ndiff --git a/pager.c b/pager.c\nindex aa0966c..19f8856 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -42,7 +42,7 @@ void setup_pager(void)\n {\n \tconst char *pager = getenv(\"GIT_PAGER\");\n \n-\tif (!isatty(1))\n+\tif (!isatty(0) || !isatty(2))\n \t\treturn;\n \tif (!pager) {\n \t\tif (!pager_program)\n\nwhich is what is mentioned in POSIX:\n\n  http://www.opengroup.org/onlinepubs/009695399/utilities/sh.html\n\nBut I don't think that makes sense here. We are not talking about\ninteractivity, but rather about where the output is going. So your test\nwould consider this interactive:\n\n  $ git log >foo.out\n\nand start a pager, which makes no sense.\n\nNow if you proposed checking stderr and stdin _in addition_ to stdout,\nthat might make more sense, but I haven't thought too hard about any\nimplications.\n\nAnd FWIW, I don't recall this ever being discussed before, but then I\nhave not been involved with git since the very beginning.\n\n-Peff\n"},{"id":"97634","messageId":"200812111645.10067.bss03@volumehost.net","threadId":"16669","inReplyTo":"20081211215554.GA11565@sigill.intra.peff.net","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss03@volumehost.net","sentAt":"2008-12-11T22:45:05Z","receivedAt":"2008-12-11T22:45:05Z","isPatch":false,"sender":{"key":"bss03@volumehost.net","avatar":"https://gravatar.com/avatar/74fa10b37dfd44462a6a30c4d4e3bda26ab7991ddb0d8ab24b022714a8ecb918?d=mp&s=160"},"body":"On Thursday 2008 December 11 15:55:55 Jeff King wrote:\n>On Thu, Dec 11, 2008 at 10:51:15AM -0600, Boyd Stephen Smith Jr. wrote:\n>> Initially, I was looking for 'stdout' or 'stderr', and found many\n>> unrelated commits.  I then figured it was part of the PAGER support, and\n>> began\n>\n>Try looking for isatty, which takes the numeric fd. I think the behavior\n>you asked about would be this:\n\nThanks, this will be plenty of context for me to be able to crawl the archives \nand the actual history thinking about better behavior and considering old \ndiscussions.\n\n>We are not talking about\n>interactivity, but rather about where the output is going. So your test\n>would consider this interactive:\n>\n>  $ git log >foo.out\n>\n>and start a pager, which makes no sense.\n\nGood point, I'll try and consider that while I investgate the history of the \nissue.\n\n>Now if you proposed checking stderr and stdin _in addition_ to stdout,\n>that might make more sense, but I haven't thought too hard about any\n>implications.\n\nI did see a commit message mentioning some unusual settings for PAGER, but in \ngeneral, pagers are interactive.  I'd think the default behavior would \nbe \"interactive <-> pager\", with a config option to turn the pager always off \nor always on.  From there, I would reason the test for interactivity should \nbe the POSIX test.\n\nIt looks like this test have have been attempting to follow the behavior \nof --color=auto to GNU less and GNU grep (and possibly others).  This \ncertainly makes some sense as well, and may be less surprising.\n\n>And FWIW, I don't recall this ever being discussed before, but then I\n>have not been involved with git since the very beginning.\n\nGoogle should be able to find it.  And worst-case, I can tell wget to spider \nthe archives and then run some sort of find/html2txt/grep on them.\n\nI'll go back to \"the stacks\" and read the discussions and commits.  If my \nwell-informed self still thinks the behavior should change, I'll write a \npatch and open up the discussion again.\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss03@volumehost.net                      ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.org/                      \\_/     \n"},{"id":"97635","messageId":"20081211225943.GA29311@coredump.intra.peff.net","threadId":"16669","inReplyTo":"200812111645.10067.bss03@volumehost.net","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-12-11T22:59:43Z","receivedAt":"2008-12-11T22:59:43Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Dec 11, 2008 at 04:45:05PM -0600, Boyd Stephen Smith Jr. wrote:\n\n> I did see a commit message mentioning some unusual settings for PAGER, but in \n> general, pagers are interactive.  I'd think the default behavior would \n> be \"interactive <-> pager\", with a config option to turn the pager always off \n> or always on.  From there, I would reason the test for interactivity should \n> be the POSIX test.\n\nRight, but then that leads to the case I mentioned before. I think you\nwant to say \"this is interactive _and_ our stdout is going to the\ninteractive spot\". Which by your definition would be isatty() on stdin,\nstderr, and stdout.\n\nAnd maybe that is a better test, but I think it would be helpful to\nprovide a concrete example where that behavior works and the current\nbehavior doesn't.\n\n> It looks like this test have have been attempting to follow the behavior \n> of --color=auto to GNU less and GNU grep (and possibly others).  This \n> certainly makes some sense as well, and may be less surprising.\n\nYes. You'll see we use a similar test for git's \"auto\" color.\n\n> >And FWIW, I don't recall this ever being discussed before, but then I\n> >have not been involved with git since the very beginning.\n> \n> Google should be able to find it.  And worst-case, I can tell wget to spider \n> the archives and then run some sort of find/html2txt/grep on them.\n\nI have the complete archive, and I couldn't find anything useful. ;)\n\nLet me know if you want a copy (or you can pull it straight from gmane,\nbut it is somewhat slow IIRC).\n\n-Peff\n"},{"id":"97636","messageId":"7vr64eb9ha.fsf@gitster.siamese.dyndns.org","threadId":"16669","inReplyTo":"200812111645.10067.bss03@volumehost.net","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-11T23:03:29Z","receivedAt":"2008-12-11T23:03:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Boyd Stephen Smith Jr.\" <bss03@volumehost.net> writes:\n\n>>  $ git log >foo.out\n>>\n>>and start a pager, which makes no sense.\n>\n> Good point, I'll try and consider that while I investgate the history of the \n> issue.\n\nIsn't the issue about 61b8050 (sending errors to stdout under $PAGER,\n2008-02-16)?  With that commit, we changed things so that when we send the\nstandard output to the $PAGER, we dup stderr to the $PAGER as well,\nbecause otherwise any output to stderr will be wiped out by whatever the\npager does and the user will not notice the breakage.  E.g.\n\n\t$ git log\n\nwill just show reams of output, and you won't see any errors and warnings\neven if there were any encountered during the process.\n\nUnfortunately we did it unconditionally.  There is no reason to dup stderr\nto the $PAGER if the command line was:\n\n\t$ git log 2>error.log\n\nin which case you would want to view the normal output in your $PAGER and\nyou are keeping the log of the error output in a separate file.\n"},{"id":"97932","messageId":"7v3agpzwet.fsf@gitster.siamese.dyndns.org","threadId":"16669","inReplyTo":"7vr64eb9ha.fsf@gitster.siamese.dyndns.org","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-15T08:15:38Z","receivedAt":"2008-12-15T08:15:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Boyd Stephen Smith Jr.\" <bss03@volumehost.net> writes:\n>\n>>>  $ git log >foo.out\n>>>\n>>>and start a pager, which makes no sense.\n>>\n>> Good point, I'll try and consider that while I investgate the history of the \n>> issue.\n>\n> Isn't the issue about 61b8050 (sending errors to stdout under $PAGER,\n> 2008-02-16)?  With that commit, we changed things so that when we send the\n> standard output to the $PAGER, we dup stderr to the $PAGER as well,\n> because otherwise any output to stderr will be wiped out by whatever the\n> pager does and the user will not notice the breakage.  E.g.\n>\n> \t$ git log\n>\n> will just show reams of output, and you won't see any errors and warnings\n> even if there were any encountered during the process.\n>\n> Unfortunately we did it unconditionally.  There is no reason to dup stderr\n> to the $PAGER if the command line was:\n>\n> \t$ git log 2>error.log\n>\n> in which case you would want to view the normal output in your $PAGER and\n> you are keeping the log of the error output in a separate file.\n\nI haven't heard anything more about this, but if you were indeed\ndiscussing the change made by 61b8050, I think the fix should just be like\nthis.\n\n pager.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git c/pager.c w/pager.c\nindex aa0966c..f19ddbc 100644\n--- c/pager.c\n+++ w/pager.c\n@@ -70,7 +70,8 @@ void setup_pager(void)\n \n \t/* original process continues, but writes to the pipe */\n \tdup2(pager_process.in, 1);\n-\tdup2(pager_process.in, 2);\n+\tif (isatty(2))\n+\t\tdup2(pager_process.in, 2);\n \tclose(pager_process.in);\n \n \t/* this makes sure that the parent terminates after the pager */\n"},{"id":"97933","messageId":"7vwse1yhgl.fsf@gitster.siamese.dyndns.org","threadId":"16669","inReplyTo":"7v3agpzwet.fsf@gitster.siamese.dyndns.org","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-15T08:23:54Z","receivedAt":"2008-12-15T08:23:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> Isn't the issue about 61b8050 (sending errors to stdout under $PAGER,\n>> 2008-02-16)?  With that commit, we changed things so that when we send the\n>> standard output to the $PAGER, we dup stderr to the $PAGER as well,\n>> because otherwise any output to stderr will be wiped out by whatever the\n>> pager does and the user will not notice the breakage.  E.g.\n>>\n>> \t$ git log\n>>\n>> will just show reams of output, and you won't see any errors and warnings\n>> even if there were any encountered during the process.\n>>\n>> Unfortunately we did it unconditionally.\n\nBy the by, I noticed that the example shown in the commit message of\n61b8050 has been broken since 4f3dcc2 (Fix 'git show' on signed tag of\nsigned tag of commit, 2008-07-01).\n\nHere is a fix.\n\n builtin-log.c |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git c/builtin-log.c w/builtin-log.c\nindex 840daf9..99d1137 100644\n--- c/builtin-log.c\n+++ w/builtin-log.c\n@@ -340,7 +340,13 @@ int cmd_show(int argc, const char **argv, const char *prefix)\n \t\t\t\t\tt->tag,\n \t\t\t\t\tdiff_get_color_opt(&rev.diffopt, DIFF_RESET));\n \t\t\tret = show_object(o->sha1, 1, &rev);\n-\t\t\tobjects[i].item = parse_object(t->tagged->sha1);\n+\t\t\tif (ret)\n+\t\t\t\tbreak;\n+\t\t\to = parse_object(t->tagged->sha1);\n+\t\t\tif (!o)\n+\t\t\t\tret = error(\"Could not read object %s\",\n+\t\t\t\t\t    sha1_to_hex(t->tagged->sha1));\n+\t\t\tobjects[i].item = o;\n \t\t\ti--;\n \t\t\tbreak;\n \t\t}\n"},{"id":"97934","messageId":"20081215082514.GA32123@coredump.intra.peff.net","threadId":"16669","inReplyTo":"7v3agpzwet.fsf@gitster.siamese.dyndns.org","subject":"Re: fatal output from git-show really wants a terminal","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-12-15T08:25:15Z","receivedAt":"2008-12-15T08:25:15Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 15, 2008 at 12:15:38AM -0800, Junio C Hamano wrote:\n\n> I haven't heard anything more about this, but if you were indeed\n> discussing the change made by 61b8050, I think the fix should just be like\n> this.\n> [...]\n> -\tdup2(pager_process.in, 2);\n> +\tif (isatty(2))\n> +\t\tdup2(pager_process.in, 2);\n\nI can't speak for the original poster, but I do think this behavior\nshould be less surprising to users who perform the one particular\nredirection (and in the other 99% of cases, should behave exactly the\nsame). So I think it's a positive change.\n\n-Peff\n"}]}