From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Narebski Subject: Re: [idea] Converting sha1 evaluator into parser/interpreter Date: Sun, 21 May 2006 12:13:50 +0200 Organization: At home Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-From: git-owner@vger.kernel.org Sun May 21 12:13:44 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FhkwQ-00064H-LI for gcvg-git@gmane.org; Sun, 21 May 2006 12:13:43 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932352AbWEUKNk (ORCPT ); Sun, 21 May 2006 06:13:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932356AbWEUKNk (ORCPT ); Sun, 21 May 2006 06:13:40 -0400 Received: from main.gmane.org ([80.91.229.2]:36566 "EHLO ciao.gmane.org") by vger.kernel.org with ESMTP id S932352AbWEUKNj (ORCPT ); Sun, 21 May 2006 06:13:39 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FhkwI-00063S-MX for git@vger.kernel.org; Sun, 21 May 2006 12:13:34 +0200 Received: from 193.0.122.19 ([193.0.122.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 May 2006 12:13:34 +0200 Received: from jnareb by 193.0.122.19 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 May 2006 12:13:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: git@vger.kernel.org X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 193.0.122.19 User-Agent: KNode/0.7.7 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Jakub Narebski wrote: > Shawn Pearce wrote: > >> 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)))) >> >> 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 )'. > > Didn't you meant to see if we get correct tree (not a forest), > and if the root of said tree is '(ref )' [1]? I'm sorry. Of course branch names (ref names) should be limited to the ones that doesn't make problems for the parser, i.e. they should parse to single element parse tree: ---parses to---> (ref ) and doesn't give problems for other parsers (e.g.commit list parser including '^A B' and 'A..B'; remotes branch mapping parser 'srcref:destref' and '+srcref:destref') and shell (e.g. globbing). P.S. Hmmm... is '--' branch name (heads/--) possible? P.P.S. Would branch name which include '!' and/or '$' cause trouble? -- Jakub Narebski Warsaw, Poland