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

Re: [PATCH] t6300: values containing ')' are broken in ref formats

From
Kousik Sanagavarapu <five231003@gmail.com>
Date
Nov 8, 2024, 18:12 UTC
Message-ID
<Zy5Ui0tHtKL1vYpw@five231003>
In-Reply-To
<20241108171637.GA548990@coredump.intra.peff.net>
On Fri, Nov 08, 2024 at 12:16:37PM -0500, Jeff King wrote:
Show 13 quoted lines
> On Fri, Nov 08, 2024 at 09:41:03AM +0530, Kousik Sanagavarapu wrote:
> 
> [...]
> 
> In the meantime yeah, you'd have to spell it as:
> 
>   %(if:equals=%(refname%29)
> 
> which is...deeply unsatisfying.
> 
> I have long dreamed of throwing out all of this format code in favor of
> a recursive parser which generates an actual tree of nodes, and
> implements all of the ref-filter/pretty.c/cat-file format placeholders.
Oh!  I remember this, let me search up the thread...
Quoting you from
	https://lore.kernel.org/git/20230901191639.GA1955435@coredump.intra.peff.net/
    IMHO the code would be a lot easier to work with if the atoms were
    structured as a parse tree with child pointers (especially when you get
    into things like "if" that have sub-expressions). I think one of the
    reasons that used_atom is an array is to de-duplicate repeated mentions
    (so if you formatted "%(foo) %(foo)" it would only have to store the
    computed value once).
    But I think that is the wrong way to optimize it. We shouldn't be
    storing any strings per-atom, but rather walking the parse tree to
    produce a single output buffer. And the values should be cheap to fill
    in, because we should parse the object as necessary up front. This is
    more or less the way the pretty.c parser does it.
> But I think it's a non-trivial task.
True.
Previous: Jeff KingNext: Kousik Sanagavarapu
Message 13 of 14 in “t6300: values containing ')' are broken in ref formats”
  1. t6300: values containing ')' are broken in ref formatsKousik Sanagavarapu, Nov 5, 2024
  2. Junio C HamanoNov 6, 2024
  3. Jeff KingNov 6, 2024
  4. Junio C HamanoNov 6, 2024
  5. Kousik SanagavarapuNov 6, 2024
  6. Jeff KingNov 6, 2024
  7. Kousik SanagavarapuNov 7, 2024
  8. Jeff KingNov 6, 2024
  9. Kousik SanagavarapuNov 7, 2024
  10. Junio C HamanoNov 7, 2024
  11. Kousik SanagavarapuNov 8, 2024
  12. Jeff KingNov 8, 2024
  13. Kousik SanagavarapuNov 8, 2024
  14. Kousik SanagavarapuNov 6, 2024

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.