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

Re: [idea] Converting sha1 evaluator into parser/interpreter

From
Jakub Narebski <jnareb@gmail.com>
Date
May 21, 2006, 08:06 UTC
Message-ID
<e4p71u$t0s$1@sea.gmane.org>
Shawn Pearce wrote:
Show 9 quoted lines
> There was just a short conversation on #git about converting
> the sha1 expression evaluator into a split parser/interpreter
> model.  The idea here would be to convert an expression such as
> 
>   HEAD@{yesterday}~3^{tree}
> 
> into a an expression tree such as (in LISP style):
> 
>   (peel-onion (walk-back 3 (date-spec yesterday (ref HEAD))))
Rather
    (peel-onion 'tree (walk-back 3 (date-spec yesterday (ref HEAD))))
 
> with such a tree it is relatively easy to evaluate the expression,
> but its also easy to determine if a ref name is valid.  Just pass
> it through the parser and see if you get back anything more complex
> then '(ref <input>)'.

Didn't you meant to see if we get correct tree (not a forest), and if the root of said tree is '(ref <commit-ish>)' [1]?

Interpreting said parse tree anch checking if it folds to correct object reference is the task of interpreter, not parser...

[*1*] if I understand currectly that <commit-ish> mean direct sha1, shortened sha1, or ref (head or tag)? commit-ish is not in git glossary...

-- 
Jakub Narebski
Warsaw, Poland
Next: Jakub Narebski
Message 1 of 2 in “Re: [idea] Converting sha1 evaluator into parser/interpreter”
  1. Jakub NarebskiMay 21, 2006
  2. Jakub NarebskiMay 21, 2006

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.