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) | ||
commit | a8335024c294db470e16e9df3aaa346bfcfbeacb | |
tree | 1fb2b119ec62cb4606294e4a509c3d271b3c53e0 | tree | snapshot |
parent | d2dadfe890b5da6f65fe061a414b6ec67c5efe9c | commit | diff |
pager: do not dup2 stderr if it is already redirected
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>
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>
pager.c | diff | blob | history |