author | Linus Torvalds <torvalds@linux-foundation.org> | |
Tue, 24 Aug 2010 17:33:59 +0000 (10:33 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 25 Aug 2010 19:11:59 +0000 (12:11 -0700) | ||
commit | 1fda91b511c76eb233f99877c60d1c5f7801f647 | |
tree | f7f85f582e353c91b42644ce6a09837e1b2bcf8a | tree | snapshot |
parent | ef45e4dae0a0f45fc72b7cd34b32dd465a38697d | commit | diff |
Fix 'git log' early pager startup error case
We start the pager too early for several git commands, which results in
the errors sometimes going to the pager rather than show up as errors.
This is often hidden by the fact that we pass in '-X' to less by default,
which causes 'less' to exit for small output, but if you do
export LESS=-S
you can then clearly see the problem by doing
git log --prretty
which shows the error message ("fatal: unrecognized argument: --prretty")
being sent to the pager.
This happens for pretty much all git commands that use USE_PAGER, and then
check arguments separately. But "git diff" does it too early too (even
though it does an explicit setup_pager() call)
This only fixes it for the trivial "git log" family case.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
We start the pager too early for several git commands, which results in
the errors sometimes going to the pager rather than show up as errors.
This is often hidden by the fact that we pass in '-X' to less by default,
which causes 'less' to exit for small output, but if you do
export LESS=-S
you can then clearly see the problem by doing
git log --prretty
which shows the error message ("fatal: unrecognized argument: --prretty")
being sent to the pager.
This happens for pretty much all git commands that use USE_PAGER, and then
check arguments separately. But "git diff" does it too early too (even
though it does an explicit setup_pager() call)
This only fixes it for the trivial "git log" family case.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c | diff | blob | history | |
git.c | diff | blob | history |