Re: [PATCH 3/3] send-pack: assign remote errors to each ref

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: <git@...>, Alex Riesen <raa.lkml@...>, Pierre Habouzit <madcoder@...>, Daniel Barkalow <barkalow@...>
Date: Saturday, November 17, 2007 - 10:39 pm

On Sat, Nov 17, 2007 at 05:03:57PM -0800, Junio C Hamano wrote:


It is actually _just_ prefixcmp. Or do you mean the strlen we call in
prefixcmp? If so, I think the right solution is to make prefixcmp
faster.  :)


Agreed.


OK. Since it is already in next, do you want a style fixup patch?


Nothing else sets the string, so the latter is not possible (perhaps it
should be "remote_error" for clarity). It is less clear that we are not
overwriting another status; however, if you look at do_send_pack, we
only actually send the remote refs that are getting REF_STATUS_OK.

A broken or malicious remote could change the push status of an
arbitrary ref to rejection, but I don't really see the point. We could
explicitly check that we are changing from OK to REMOTE_REJECTED in
set_ref_error.


That is a reasonable behavior (although they have already seen an
"error: " message, I think). We might also consider returning something
besides "-1" to differentiate "ok, but some refs failed" from "terribly
broken". The old code used to use "-2" and "-4", but I checked and all
of the error checking paths seemed to end up as a boolean.

I can work up a patch if there is consensus.

-Peff
-
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 v3 0/3] tracking per-ref errors on push, Jeff King, (Sat Nov 17, 8:53 am)
Re: [PATCH 3/3] send-pack: assign remote errors to each ref, Jeff King, (Sat Nov 17, 10:39 pm)
Re: [PATCH 3/3] send-pack: assign remote errors to each ref, Junio C Hamano, (Sun Nov 18, 12:47 am)
Re: [PATCH 3/3] send-pack: assign remote errors to each ref, Daniel Barkalow, (Sat Nov 17, 2:05 pm)
[PATCH 1/3] send-pack: track errors for each ref, Jeff King, (Sat Nov 17, 8:54 am)
Re: [PATCH 1/3] send-pack: track errors for each ref, Junio C Hamano, (Sat Nov 17, 4:53 pm)
Re: [PATCH 1/3] send-pack: track errors for each ref, Daniel Barkalow, (Sat Nov 17, 2:05 pm)
Re: [PATCH 1/3] send-pack: track errors for each ref, Junio C Hamano, (Sat Nov 17, 9:21 pm)
Re: [PATCH 1/3] send-pack: track errors for each ref, Jeff King, (Sat Nov 17, 11:12 pm)
Re: [PATCH 1/3] send-pack: track errors for each ref, Alex Riesen, (Sat Nov 17, 9:34 am)