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

Re: [GSoC PATCH] t1420-lost-found.sh: use test_path_is_file for error logging

From
ACAndrew Chitester <andchi@fastmail.com>
Date
Jan 8, 2026, 01:30 UTC
Message-ID
<87v7hcvqk1.fsf@fastmail.com>
In-Reply-To
<xmqq4ip0n3mm.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> Looks correct, but given that what these tests want to ensure is
> that underneath .git/lost-found there are only these two expected
> files, I have to wonder if the output of "ls" here is expected to be
> very stable.  I.e. if we rewrote the whole thing to something like
> ...
>
> 	ls .git/lost-found/*/* >actual &&
> 	cat >expect <<-EOF &&
> 	.git/lost-found/commit/$(cat lost-commit)
> 	.git/lost-found/other/$(cat lost-other)
> 	EOF
> 	test_cmp expect actual
>
> ... would it be a more direct way to say that and is easier to
> understand to our readers.

Thanks for the feedback. This is an elegant solution that I did not consider. Looking through the other tests, I am seeing this similar pattern of comparing an expected result with the actual result. It is much more deliberate and readable this way. I sent a v2, as a reply to my original message, but I think I forgot to Cc you in that message. I'm still figuring out the email workflow.

Previous: Junio C HamanoNext: Andrew Chitester
Message 3 of 4 in “t1420-lost-found.sh: use test_path_is_file for error logging”
  1. t1420-lost-found.sh: use test_path_is_file for error loggingAndrew Chitester, Jan 4, 2026
  2. Junio C HamanoJan 5, 2026
  3. Andrew ChitesterJan 8, 2026
  4. 1/1 t1420: modernize the lost-found testAndrew Chitester, Jan 6, 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.