Re: [PATCH/RFC] Have git-cvsserver call hooks/update before really altering the ref
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 14, 2007, 09:33 UTC
- Message-ID
- <7vfy99t761.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <200702140913.55506.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
Show 8 quoted lines
> On Wednesday 2007 February 14 05:36, Junio C Hamano wrote: > >> Everybody else seems to say 'print "error 1 blah blah"'. Are >> you sure "error 2 message" is Kosher protocol-wise? > > Oops. No I'm not sure at all. I hadn't noticed that was a protocol command; > I'd read it as being output to stderr which appears to be just commentary to > the CVS client. I assume you don't want a patch just to correct that?
I did not even read the protocol when I wondered what that 2 vs 1 was, and I wanted to know what was the right thing to send to the client. In other words, I was lazy ;-)
`error ERRNO-CODE ` ' TEXT \n'
The command completed with an error. ERRNO-CODE is a symbolic
error code (e.g. `ENOENT'); if the server doesn't support this
feature, or if it's not appropriate for this particular message,
it just omits the errno-code (in that case there are two spaces
after `error'). Text is an error message such as that provided by
strerror(), or any other message the server wants to use. The
TEXT is like the `M' response, in the sense that it is not
particularly intended to be machine-parsed; servers may wish to
print an error message with `MT' responses, and then issue a
`error' response without TEXT (although it should be noted that
`MT' currently has no way of flagging the output as intended for
standard error, the way that the `E' response does).I suspect Martin and Martyn chose 1 to match EPERM (I am looking at /usr/include/asm-generic/errno-base.h), and I think your new error case falls into EPERM category as well. Since your patch is currently queued in 'pu', I can just go ahead and fix it myself with "git commit --amend", but an Ack from down under would certainly be appreciated ;-).