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

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.
Previous: Eric Wong
Message 5 of 5 in “Make '@' not valid in a ref name.”
  1. Make '@' not valid in a ref name.Shawn Pearce, May 21, 2006
  2. Junio C HamanoMay 21, 2006
  3. Shawn PearceMay 21, 2006
  4. Eric WongMay 21, 2006
  5. Shawn PearceMay 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.