login
Header Space

 
 

Re: [PATCH] Permit refspec source side to parse as a sha1

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: <git@...>, Samuel Tardieu <sam@...>
Date: Friday, March 21, 2008 - 1:09 am

On Thu, 20 Mar 2008, Junio C Hamano wrote:


No, HEAD is syntactically valid as a ref, so it's accepted regardless of 
anything else.


Unfortunately, there's not (so far as I know) a handy way to check the 
syntax of a sha1 name.


We enforce additional, purpose-specific error-checking after parsing, when 
we're actually trying to use the refspecs. The problem is that we can't 
make the syntactic check sufficient lenient to cover all valid syntax, but 
tight enough to prohibit any syntax errors, without getting tangled in a 
bit of semantics.


The syntax is identical. The semantics is not the parser's problem, and is 
more appropriate for the callers to handle.


Not really. If you're fetching, and you have a push refspec configured for 
the same ref, and that refspec has a LHS which, for the current HEAD, 
doesn't refer to a valid commit at the moment, that's fine. It's only a 
problem if you try to use it while it doesn't point at a valid commit, or 
if it isn't valid syntax for a sha1 name (like HEAD*2).


So we should call the same code to parse the string, have that code do no 
validation at all, and have the caller validate the return as appropriate. 
The parsing doesn't depend at all on whether it's for fetching or pushing.


I think it was that we used to break "push = HEAD", but we support it now.

	-Daniel
*This .sig left intentionally blank*
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Permit refspec source side to parse as a sha1, Daniel Barkalow, (Thu Mar 20, 8:54 pm)
Re: [PATCH] Permit refspec source side to parse as a sha1, Junio C Hamano, (Fri Mar 21, 12:10 am)
Re: [PATCH] Permit refspec source side to parse as a sha1, Daniel Barkalow, (Fri Mar 21, 1:09 am)
Re: [PATCH] Permit refspec source side to parse as a sha1, Junio C Hamano, (Fri Mar 21, 1:30 am)
Re: [PATCH] Permit refspec source side to parse as a sha1, Daniel Barkalow, (Fri Mar 21, 1:57 am)
Re: [PATCH] Permit refspec source side to parse as a sha1, Junio C Hamano, (Fri Mar 21, 2:26 am)
Re: [PATCH] Permit refspec source side to parse as a sha1, Daniel Barkalow, (Fri Mar 21, 12:08 pm)
Re: [PATCH] Permit refspec source side to parse as a sha1, Junio C Hamano, (Fri Mar 21, 12:50 am)
speck-geostationary