From: Junio C Hamano <gitster@pobox.com>
To: "Boyd Stephen Smith Jr." <bss03@volumehost.net>
Cc: Jeff King <peff@peff.net>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
git@vger.kernel.org
Subject: Re: fatal output from git-show really wants a terminal
Date: Mon, 15 Dec 2008 00:15:38 -0800 [thread overview]
Message-ID: <7v3agpzwet.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vr64eb9ha.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 11 Dec 2008 15:03:29 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> "Boyd Stephen Smith Jr." <bss03@volumehost.net> writes:
>
>>> $ git log >foo.out
>>>
>>>and start a pager, which makes no sense.
>>
>> Good point, I'll try and consider that while I investgate the history of the
>> issue.
>
> Isn't the issue about 61b8050 (sending errors to stdout under $PAGER,
> 2008-02-16)? With that commit, we changed things so that when we send the
> standard output to the $PAGER, we dup stderr to the $PAGER as well,
> because otherwise any output to stderr will be wiped out by whatever the
> pager does and the user will not notice the breakage. E.g.
>
> $ git log
>
> will just show reams of output, and you won't see any errors and warnings
> even if there were any encountered during the process.
>
> Unfortunately we did it unconditionally. There is no reason to dup stderr
> to the $PAGER if the command line was:
>
> $ git log 2>error.log
>
> in which case you would want to view the normal output in your $PAGER and
> you are keeping the log of the error output in a separate file.
I haven't heard anything more about this, but if you were indeed
discussing the change made by 61b8050, I think the fix should just be like
this.
| 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
--git c/pager.c w/pager.c
index aa0966c..f19ddbc 100644
--- c/pager.c
+++ w/pager.c
@@ -70,7 +70,8 @@ void setup_pager(void)
/* original process continues, but writes to the pipe */
dup2(pager_process.in, 1);
- dup2(pager_process.in, 2);
+ if (isatty(2))
+ dup2(pager_process.in, 2);
close(pager_process.in);
/* this makes sure that the parent terminates after the pager */
next prev parent reply other threads:[~2008-12-15 8:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-10 16:01 fatal output from git-show really wants a terminal Tim Olsen
2008-12-10 16:10 ` Boyd Stephen Smith Jr.
2008-12-10 19:46 ` Johannes Sixt
2008-12-10 20:10 ` Tim Olsen
2008-12-10 22:24 ` Boyd Stephen Smith Jr.
[not found] ` <alpine.DEB.1.00.0812111015140.18321@eeepc-johanness>
2008-12-11 16:51 ` Boyd Stephen Smith Jr.
2008-12-11 21:55 ` Jeff King
2008-12-11 22:45 ` Boyd Stephen Smith Jr.
2008-12-11 22:59 ` Jeff King
2008-12-11 23:03 ` Junio C Hamano
2008-12-15 8:15 ` Junio C Hamano [this message]
2008-12-15 8:23 ` Junio C Hamano
2008-12-15 8:25 ` Jeff King
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=7v3agpzwet.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=bss03@volumehost.net \
--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).