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

Re: [PATCH v2] remote-curl: Use auth for probe_rpc() requests too

From
Jeff King <peff@peff.net>
Date
Jan 14, 2026, 17:30 UTC
Message-ID
<20260114173055.GD885771@coredump.intra.peff.net>
In-Reply-To
<613b47af-5269-44e3-87f5-d29fba9d73b3@nvidia.com>
On Wed, Jan 14, 2026 at 08:33:43AM -0800, Aaron Plattner wrote:
Show 22 quoted lines
> Ooh, neat. I guess I copied the wrong example. I verified that this works
> too, so I can send a v5 for that.
> 
> Is it worth changing up the other cases of this pattern, mostly in
> pack-refs-tests.sh? E.g.,
> 
> 	# Create 15 loose references.
> 	printf "create refs/heads/loose-%d HEAD\n" $(test_seq 15) >stdin &&
> 	git update-ref --stdin <stdin &&
> 
> [...]
> 
> 	# Create 99 packed refs. This should cause the heuristic
> 	# to require more than the minimum amount of loose refs.
> 	test_seq 99 |
> 	while read i
> 	do
> 		printf "create refs/heads/packed-%d HEAD\n" $i || return 1
> 	done >stdin &&
> 	git update-ref --stdin <stdin &&
> 
> I can put together a patch for those.

Yeah, I think they are worth updating. I looked for spots to convert when I added the feature in b32c7ec02f (test-lib: teach test_seq the -f option, 2025-06-23). But I missed those ones.

I think I grepped for "for i in $(test_seq ...)", but the use of the while loop and the $()-substitution meant I didn't see them. Examining every test_seq call didn't seem worthwhile, as there are hundreds. ;)

Grepping for "test_seq .* |" does yield a few more (e.g., p5551), but most are false positives. Grepping for "printf.*$(test_seq" gets some more.

I don't know that we need to exhaustively find all cases. ;) In the first case above, it does save us a subshell. In the second case I think it saves us a subshell _and_ the result is much easier to read (because it avoids the loop and return). So IMHO it's a nice improvement, but there's diminishing returns to investigating every test_seq call.

-Peff
Previous: Aaron PlattnerNext: Junio C Hamano
Message 8 of 9 in “remote-curl: Use auth for probe_rpc() requests too”
  1. remote-curl: Use auth for probe_rpc() requests tooAaron Plattner, Jan 13, 2026
  2. Patrick SteinhardtJan 13, 2026
  3. Junio C HamanoJan 13, 2026
  4. Aaron PlattnerJan 14, 2026
  5. Jeff KingJan 14, 2026
  6. Junio C HamanoJan 14, 2026
  7. Aaron PlattnerJan 14, 2026
  8. Jeff KingJan 14, 2026
  9. Junio C HamanoJan 14, 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.