summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d2dadfe)
raw | patch | inline | side by side (parent: d2dadfe)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 15 Dec 2008 08:33:34 +0000 (00:33 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 15 Dec 2008 09:37:15 +0000 (01:37 -0800) |
An earlier commit 61b8050 (sending errors to stdout under $PAGER,
2008-02-16) avoided losing the error messages that are sent to the
standard error when $PAGER is in effect by dup2'ing fd 2 to the pager.
his way, showing a tag object that points to a bad object:
$ git show tag-foo
would give the error message to the pager. However, it was not quite
right if the user did:
$ git show 2>error.log tag-foo
i.e. use the pager but store the errors in a separate file.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16) avoided losing the error messages that are sent to the
standard error when $PAGER is in effect by dup2'ing fd 2 to the pager.
his way, showing a tag object that points to a bad object:
$ git show tag-foo
would give the error message to the pager. However, it was not quite
right if the user did:
$ git show 2>error.log tag-foo
i.e. use the pager but store the errors in a separate file.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pager.c | patch | blob | history |
index 6b5c9e44b4ded338ddb344ae454d83a685b7569a..0b7e55f476ac17609d88821e78bd89a511f4b3aa 100644 (file)
--- a/pager.c
+++ b/pager.c
/* 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 */