git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] log: Non-zero exit code?

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Aug 21, 2010, 07:33 UTC
Message-ID
<4C6F8164.3020005@lsrfire.ath.cx>
In-Reply-To
<20100821062158.GJ6211@kytes>
Am 21.08.2010 08:22, schrieb Ramkumar Ramachandra:
Show 37 quoted lines
> 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é
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 3 of 4 in “[BUG] log: Non-zero exit code?”
  1. Ramkumar RamachandraAug 21, 2010
  2. Ramkumar RamachandraAug 21, 2010
  3. René ScharfeAug 21, 2010
  4. Ramkumar RamachandraAug 21, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.