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

Re: [PATCH v2] new --dirty option for git describe

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 20, 2009, 16:30 UTC
Message-ID
<7vmy3mownl.fsf@alter.siamese.dyndns.org>
In-Reply-To
<dffdbd190910200727r30e161ffka0b3cf764be26cd8@mail.gmail.com>
Jean Privat <jean@pryen.org> writes:
> +test_expect_success 'describe --dirty HEAD' '
> +	git describe --dirty HEAD
> +	test $? != 0
> +'
We tend to write this as
	test_expect_success '...' '
        	test_must_fail git describe --dirty HEAD
	'

The difference is when the tested command segfaults or dies in an uncontrolled fashion; test_must_fail diagnoses it as a failure, while "test $? != 0" at the end will say "ok, the command correctly failed".

Previous: Jean Privat
Message 3 of 3 in “new --dirty option for git describe”
  1. new --dirty option for git describeJean Privat, Oct 20, 2009
  2. Jean PrivatOct 20, 2009
  3. Junio C HamanoOct 20, 2009

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.