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:17 UTC
Message-ID
<20251112071757.GC431661@coredump.intra.peff.net>
In-Reply-To
<20251112070907.GA431661@coredump.intra.peff.net>
On Wed, Nov 12, 2025 at 02:09:07AM -0500, Jeff King wrote:
Show 6 quoted lines
> Though I think you might be able to chain macros across files (so
> ".gitattributes" introduces macro "foo", and the "sub/.gitattributes"
> introduces "bar" which resolves to "foo", and so on). In which case your
> total size is larger, and only eventually limited by how deep a tree
> we'll accept (another place where we recurse, but there is a
> configurable depth limit).

I did poke at this briefly, and the answer is: no, you can't do that. We allow macro definitions only at the top-level. Which makes sense, as otherwise you get into confusing dependencies between files.

-Peff
Previous: Jeff KingNext: Patrick Steinhardt
Message 4 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.