{"thread":{"id":"4230","subject":"Re: [idea] Converting sha1 evaluator into parser/interpreter","startedAt":"2006-05-21T08:06:45Z","lastAt":"2006-05-21T10:13:50Z","messageCount":2,"participants":["Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"20378","messageId":"e4p71u$t0s$1@sea.gmane.org","threadId":"4230","inReplyTo":null,"subject":"Re: [idea] Converting sha1 evaluator into parser/interpreter","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-05-21T08:06:45Z","receivedAt":"2006-05-21T08:06:45Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Shawn Pearce wrote:\n\n> There was just a short conversation on #git about converting\n> the sha1 expression evaluator into a split parser/interpreter\n> model.  The idea here would be to convert an expression such as\n> \n>   HEAD@{yesterday}~3^{tree}\n> \n> into a an expression tree such as (in LISP style):\n> \n>   (peel-onion (walk-back 3 (date-spec yesterday (ref HEAD))))\n\nRather\n\n    (peel-onion 'tree (walk-back 3 (date-spec yesterday (ref HEAD))))\n \n> with such a tree it is relatively easy to evaluate the expression,\n> but its also easy to determine if a ref name is valid.  Just pass\n> it through the parser and see if you get back anything more complex\n> then '(ref <input>)'.\n\nDidn't you meant to see if we get correct tree (not a forest), \nand if the root of said tree is '(ref <commit-ish>)' [1]?\n\nInterpreting said parse tree anch checking if it folds to correct object\nreference is the task of interpreter, not parser...\n\n\n[*1*] if I understand currectly that <commit-ish> mean direct sha1,\nshortened sha1, or ref (head or tag)? commit-ish is not in \ngit glossary...\n\n-- \nJakub Narebski\nWarsaw, Poland\n"},{"id":"20392","messageId":"e4peg7$g3b$1@sea.gmane.org","threadId":"4230","inReplyTo":"e4p71u$t0s$1@sea.gmane.org","subject":"Re: [idea] Converting sha1 evaluator into parser/interpreter","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-05-21T10:13:50Z","receivedAt":"2006-05-21T10:13:50Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jakub Narebski wrote:\n\n> Shawn Pearce wrote:\n> \n>> There was just a short conversation on #git about converting\n>> the sha1 expression evaluator into a split parser/interpreter\n>> model.  The idea here would be to convert an expression such as\n>> \n>>   HEAD@{yesterday}~3^{tree}\n>> \n>> into a an expression tree such as (in LISP style):\n>> \n>>   (peel-onion (walk-back 3 (date-spec yesterday (ref HEAD))))\n>>\n>> with such a tree it is relatively easy to evaluate the expression,\n>> but its also easy to determine if a ref name is valid.  Just pass\n>> it through the parser and see if you get back anything more complex\n>> then '(ref <input>)'.\n> \n> Didn't you meant to see if we get correct tree (not a forest), \n> and if the root of said tree is '(ref <commit-ish>)' [1]?\n\nI'm sorry. Of course branch names (ref names) should be limited to the ones\nthat doesn't make problems for the parser, i.e. they should parse to single\nelement parse tree:\n\n   <input> ---parses to---> (ref <input>)\n\nand doesn't give problems for other parsers (e.g.commit list parser\nincluding '^A B' and 'A..B'; remotes branch mapping parser 'srcref:destref'\nand '+srcref:destref') and shell (e.g. globbing).\n\n\nP.S. Hmmm... is '--' branch name (heads/--) possible?\nP.P.S. Would branch name which include '!' and/or '$' cause trouble?\n\n-- \nJakub Narebski\nWarsaw, Poland\n"}]}