* [BUG] log: Non-zero exit code?
@ 2010-08-21 6:22 Ramkumar Ramachandra
2010-08-21 6:31 ` Ramkumar Ramachandra
2010-08-21 7:33 ` René Scharfe
0 siblings, 2 replies; 4+ messages in thread
From: Ramkumar Ramachandra @ 2010-08-21 6:22 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano
Hi,
Here's a quick patch to illustrate the bug report. I initially thought
Bo Yang's series was at fault, but a quick checkout-make tells me that
the problem is much deeper- Am I doing something wrong? How did we not
notice this problem for so long?
-- 8< --
From: Ramkumar Ramachandra <artagnon@gmail.com>
Date: Sat, 21 Aug 2010 11:44:13 +0530
Subject: [PATCH] log: test to check exit code
Add a test to check the exit code of a simple 'git log'
invocation. The test currently fails: the exit code seems to be 141,
instead of the expected 0.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
t/t4202-log.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 2e51356..bd05bc9 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -37,6 +37,12 @@ test_expect_success setup '
'
+test_expect_success 'exit code' '
+
+ git log
+ test_cmp $? 0
+'
+
printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial" > expect
test_expect_success 'pretty' '
--
1.7.2.2.409.gdbb11.dirty
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [BUG] log: Non-zero exit code?
2010-08-21 6:22 [BUG] log: Non-zero exit code? Ramkumar Ramachandra
@ 2010-08-21 6:31 ` Ramkumar Ramachandra
2010-08-21 7:33 ` René Scharfe
1 sibling, 0 replies; 4+ messages in thread
From: Ramkumar Ramachandra @ 2010-08-21 6:31 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano
Hi,
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index 2e51356..bd05bc9 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -37,6 +37,12 @@ test_expect_success setup '
>
> '
>
> +test_expect_success 'exit code' '
> +
> + git log
> + test_cmp $? 0
> +'
> +
Er, I meant test $? = 0.
-- Ram
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [BUG] log: Non-zero exit code?
2010-08-21 6:22 [BUG] log: Non-zero exit code? Ramkumar Ramachandra
2010-08-21 6:31 ` Ramkumar Ramachandra
@ 2010-08-21 7:33 ` René Scharfe
2010-08-21 7:46 ` Ramkumar Ramachandra
1 sibling, 1 reply; 4+ messages in thread
From: René Scharfe @ 2010-08-21 7:33 UTC (permalink / raw)
To: Ramkumar Ramachandra; +Cc: Git Mailing List, Junio C Hamano
Am 21.08.2010 08:22, schrieb Ramkumar Ramachandra:
> Hi,
>
> Here's a quick patch to illustrate the bug report. I initially thought
> Bo Yang's series was at fault, but a quick checkout-make tells me that
> the problem is much deeper- Am I doing something wrong? How did we not
> notice this problem for so long?
>
> -- 8< --
> From: Ramkumar Ramachandra <artagnon@gmail.com>
> Date: Sat, 21 Aug 2010 11:44:13 +0530
> Subject: [PATCH] log: test to check exit code
>
> Add a test to check the exit code of a simple 'git log'
> invocation. The test currently fails: the exit code seems to be 141,
> instead of the expected 0.
>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> ---
> t/t4202-log.sh | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index 2e51356..bd05bc9 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -37,6 +37,12 @@ test_expect_success setup '
>
> '
>
> +test_expect_success 'exit code' '
> +
> + git log
> + test_cmp $? 0
> +'
> +
> printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial" > expect
> test_expect_success 'pretty' '
> Er, I meant test $? = 0.
>
> -- Ram
You can leave out the test line entirely, as test_expect_success already
checks for an exit code of zero.
The test passes for me with 1.7.2.2, next and pu. Which version of git
do you use?
Error code 141 smells like the pager. Can you reproduce the problem
without the pager, i.e. like this?
git --no-pager log
René
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [BUG] log: Non-zero exit code?
2010-08-21 7:33 ` René Scharfe
@ 2010-08-21 7:46 ` Ramkumar Ramachandra
0 siblings, 0 replies; 4+ messages in thread
From: Ramkumar Ramachandra @ 2010-08-21 7:46 UTC (permalink / raw)
To: René Scharfe
Cc: Git Mailing List, Junio C Hamano,
Ævar Arnfjörð Bjarmason
Hi René,
René Scharfe writes:
> You can leave out the test line entirely, as test_expect_success already
> checks for an exit code of zero.
Right. I should have actually read test-lib.sh before submitting a
test :p
> The test passes for me with 1.7.2.2, next and pu. Which version of git
> do you use?
I can reproduce this on the latest `master` and `pu`.
> Error code 141 smells like the pager. Can you reproduce the problem
> without the pager, i.e. like this?
>
> git --no-pager log
Indeed, it's a pager problem as Ævar pointed out on IRC. $(git
--no-pager log) and $(GIT_PAGER='perl -pe ""' git log) return
0. Something in `less` changed?
-- Ram
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-21 7:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-21 6:22 [BUG] log: Non-zero exit code? Ramkumar Ramachandra
2010-08-21 6:31 ` Ramkumar Ramachandra
2010-08-21 7:33 ` René Scharfe
2010-08-21 7:46 ` Ramkumar Ramachandra
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).