{"thread":{"id":"4226","subject":"[PATCH] Make '@' not valid in a ref name.","startedAt":"2006-05-21T01:37:51Z","lastAt":"2006-05-21T02:19:20Z","messageCount":5,"participants":["Shawn Pearce","Junio C Hamano","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"20364","messageId":"20060521013751.GA7516@spearce.org","threadId":"4226","inReplyTo":null,"subject":"[PATCH] Make '@' not valid in a ref name.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-05-21T01:37:51Z","receivedAt":"2006-05-21T01:37:51Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Now that the sha1 expression syntax supports looking up a ref's\nvalue at a prior point in time through the '@' operator the '@'\noperator should not be permitted in a ref name.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n\n---\n\n90d3212d5351d2f6c6ad33578c9f9df2e07af12e\n refs.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\n90d3212d5351d2f6c6ad33578c9f9df2e07af12e\ndiff --git a/refs.c b/refs.c\nindex eeb1196..2530c99 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -213,14 +213,14 @@ int get_ref_sha1(const char *ref, unsign\n  *\n  * - any path component of it begins with \".\", or\n  * - it has double dots \"..\", or\n- * - it has ASCII control character, \"~\", \"^\", \":\" or SP, anywhere, or\n+ * - it has ASCII control character, \"@\", \"~\", \"^\", \":\" or SP,\n  * - it ends with a \"/\".\n  */\n \n static inline int bad_ref_char(int ch)\n {\n \treturn (((unsigned) ch) <= ' ' ||\n-\t\tch == '~' || ch == '^' || ch == ':' ||\n+\t\tch == '@' || ch == '~' || ch == '^' || ch == ':' ||\n \t\t/* 2.13 Pattern Matching Notation */\n \t\tch == '?' || ch == '*' || ch == '[');\n }\n-- \n1.3.3.gfad60\n"},{"id":"20365","messageId":"7vodxsywzk.fsf@assigned-by-dhcp.cox.net","threadId":"4226","inReplyTo":"20060521013751.GA7516@spearce.org","subject":"Re: [PATCH] Make '@' not valid in a ref name.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-21T01:42:23Z","receivedAt":"2006-05-21T01:42:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I am not a fan of retroactively disallowing what we used to\nallow.  Is this unavoidable?\n"},{"id":"20367","messageId":"20060521015849.GB7605@spearce.org","threadId":"4226","inReplyTo":"7vodxsywzk.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Make '@' not valid in a ref name.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-05-21T01:58:49Z","receivedAt":"2006-05-21T01:58:49Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> I am not a fan of retroactively disallowing what we used to\n> allow.  Is this unavoidable?\n> \n\nWe're talking about it on #git right now.  Someone actually uses\nrefs like 'user@host/foo' and thus doesn't like this patch either.\n\nWe were talking about disallowing '@{' instead.  Really its just\n'@{<some run that smells like a date}' at the end of the ref which\nwould want to be disallowed; similiar to how ~ and ^ really only\nneed to be disallowed near the end.\n\nThe date parser grabs '@{' not '@' so 'user@host/foo@{yesterday}'\nmakes sense to it.  But 'user@{host}/foo@{yesterday}' is going\nto cause problems as the date parser will attempt to evaluate\n'host}/foo@{yesterday'.  :-(\n\n-- \nShawn.\n"},{"id":"20368","messageId":"20060521020038.GA22926@hand.yhbt.net","threadId":"4226","inReplyTo":"20060521013751.GA7516@spearce.org","subject":"Re: [PATCH] Make '@' not valid in a ref name.","fromName":"Eric Wong","fromEmail":"normalperson@hand.yhbt.net","sentAt":"2006-05-21T02:00:38Z","receivedAt":"2006-05-21T02:00:38Z","isPatch":true,"sender":{"key":"normalperson@hand.yhbt.net","avatar":null},"body":"Shawn Pearce <spearce@spearce.org> wrote:\n> Now that the sha1 expression syntax supports looking up a ref's\n> value at a prior point in time through the '@' operator the '@'\n> operator should not be permitted in a ref name.\n\nThis would break git-archimport (where email addresses are the first\npart of the branch/tag names).\n\n-- \nEric Wong\n"},{"id":"20370","messageId":"20060521021919.GA7700@spearce.org","threadId":"4226","inReplyTo":"20060521020038.GA22926@hand.yhbt.net","subject":"Re: [PATCH] Make '@' not valid in a ref name.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-05-21T02:19:20Z","receivedAt":"2006-05-21T02:19:20Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Eric Wong <normalperson@hand.yhbt.net> wrote:\n> Shawn Pearce <spearce@spearce.org> wrote:\n> > Now that the sha1 expression syntax supports looking up a ref's\n> > value at a prior point in time through the '@' operator the '@'\n> > operator should not be permitted in a ref name.\n> \n> This would break git-archimport (where email addresses are the first\n> part of the branch/tag names).\n\nOK, so this patch is quite unpopular and should never make it\ninto GIT.  I'm glad we have many eyes on this mailing list!\n\n\nThere was just a short conversation on #git about converting\nthe sha1 expression evaluator into a split parser/interpreter\nmodel.  The idea here would be to convert an expression such as\n\n  HEAD@{yesterday}~3^{tree}\n\ninto a an expression tree such as (in LISP style):\n\n  (peel-onion (walk-back 3 (date-spec yesterday (ref HEAD))))\n\nwith such a tree it is relatively easy to evaluate the expression,\nbut its also easy to determine if a ref name is valid.  Just pass\nit through the parser and see if you get back anything more complex\nthen '(ref <input>)'.\n\nComments?\n\n-- \nShawn.\n"}]}