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

Re: [PATCH] attr: avoid recursion when expanding attribute macros

From
Jeff King <peff@peff.net>
Date
Nov 12, 2025, 07:16 UTC
Message-ID
<20251112071651.GB431661@coredump.intra.peff.net>
In-Reply-To
<aRQvyvMq61syGT7_@pks.im>
On Wed, Nov 12, 2025 at 07:57:14AM +0100, Patrick Steinhardt wrote:
Show 11 quoted lines
> So personally I would've probably leaned into the direction of enforcing
> a hard limit. I don't see a reason why anybody would need more than a
> couple of recursions, it culls both compute and memory growth, and it
> allows us to have a proper error message in case the limit is busted.
> Furthermore, we can demonstrate right now that it wasn't possible to
> have unlimited recursion anyway, which makes it easier to put a new
> limit into place.
> 
> But following my above reasoning I think it's okay to turn this into
> iteration, as well, though, but I'd like to hear whether my train of
> thought matches yours.

Yeah, it does match mine. If I wanted to waste a bunch of CPU and memory on a hosting site, there are a lot easier ways to do that than with really long gitattributes.

I'm not at all opposed to putting in a hard limit on top. My general feeling is that it never hurts to convert recursion to iteration; it only gives us more options. I'm not planning to work on a hard limit myself, but if you want to, be my guest. :)

I think if we do (or even if we don't), it may also be reasonable to shrink the max attribute file size to 10MB or even smaller.

-Peff
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 6 of 8 in “attr: avoid recursion when expanding attribute macros”
  1. attr: avoid recursion when expanding attribute macrosJeff King, Nov 11, 2025
  2. Ben KnobleNov 12, 2025
  3. Jeff KingNov 12, 2025
  4. Jeff KingNov 12, 2025
  5. Patrick SteinhardtNov 12, 2025
  6. Jeff KingNov 12, 2025
  7. Patrick SteinhardtNov 12, 2025
  8. Junio C HamanoNov 12, 2025

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.