Re: [PATCH] Make '@' not valid in a ref name.
- From
Shawn Pearce <spearce@spearce.org>
- Date
- May 21, 2006, 02:19 UTC
- Message-ID
- <20060521021919.GA7700@spearce.org>
- In-Reply-To
- <20060521020038.GA22926@hand.yhbt.net>
Eric Wong <normalperson@hand.yhbt.net> wrote:
Show 7 quoted lines
> Shawn Pearce <spearce@spearce.org> wrote: > > Now that the sha1 expression syntax supports looking up a ref's > > value at a prior point in time through the '@' operator the '@' > > operator should not be permitted in a ref name. > > This would break git-archimport (where email addresses are the first > part of the branch/tag names).
OK, so this patch is quite unpopular and should never make it into GIT. I'm glad we have many eyes on this mailing list!
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 <input>)'.
Comments?
-- Shawn.