On Sun, Mar 25, 2012 at 11:52:35AM +0200, Ivan Todoroski wrote: > >>-static int rpc_service(struct rpc_state *rpc, struct discovery *heads) > >>+static int rpc_service(struct rpc_state *rpc, struct discovery *heads, > >>+ int nr_fetch, struct ref **to_fetch) > [...] > Yeah, I realized this was ugly after I sent it.... not only are new > arguments added to rpc_service(), but they seem completely arbitrary > and specific to fetch-pack. There is no reason other callers of > rpc_service() would want args in the exact same format. Yeah, I think that is what was bugging me about it. > On the other hand I can't reuse rpc_state.argv because that is > already passed to client.argv for start_command(). Right. You'd need a new member. > Would it be OK if I add a new memeber in rpc_state, e.g. "struct > strbuf *stdin_preamble"? If non-NULL, it would contain any data the > caller of rpc_service() wants shoved into the stdin of the > sub-command before anything else. That way the caller is free to > format this data in whatever format they need, not only in the > pkt-line format needed by fetch-pack. I think that is the cleanest solution. It's a little less efficient, in that we build the whole buffer in memory instead of sending each packet as we form it. But I think we are talking about a few kilobytes at most. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html