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

Re: [PATCH] t: use test_must_fail instead of NOT operator

From
Hardik Kumar <hardikxk@gmail.com>
Date
Nov 16, 2026, 17:33 UTC
Message-ID
<DMWTDHJGGUD8.2ZZHA8YHM7EU4@gmail.com>
In-Reply-To
<xmqqcxs4n4k0.fsf@gitster.g>
On Mon Nov 16, 2026 at 9:37 PM IST, Junio C Hamano wrote:
Show 21 quoted lines
> All of them look sensible, but I am curious why you chose only
> these, among 14 hits in
>
>     $ git grep -l '^[ 	]*! git ' t/
>
> I suspect that it is because these are ...
>
>> -	! git clone -c http.proxy=localhost/path https://example.com/repo.git 2>err && {
>> -	! git clone -c http.proxy=socks4://127.0.0.1/path https://example.com/repo.git 2>err && {
>> -	! git bisect run ./fail.sh 2>err &&
>> -	! git bisect run ./fail.sh 2>err &&
>
> ... simple cases in which the use of leading ! negation is the only
> issue with them, and if that is the reasoning, I think that is
> sensible.  Contrasting these, many of the hits in t2206 (one among
> 14 hits in the above grep), for example, look like this:
>
>   ! git status --porcelain | grep "^.*$" &&
>
> which violates "do not hide exit status of git behind a pipe" rule,
> in addition to have a strange looking leading ! negation.

Yes, I should've mentioned the reason for not replacing the other instances in the patch reply. I just trying keeping the patch to these specific cases as they were the obvious standouts.

Thanks.
Previous: Junio C Hamano
Message 3 of 3 in “t: use test_must_fail instead of NOT operator”
  1. t: use test_must_fail instead of NOT operatorHardik Kumar, Nov 15, 2026
  2. Junio C HamanoNov 16, 2026
  3. Hardik KumarNov 16, 2026

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.