Re: [PATCH v5 14/40] external-odb: accept only blobs for now
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 3, 2017, 19:52 UTC
- Message-ID
- <xmqq7eykxwbt.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170803091926.1755-15-chriscool@tuxfamily.org>
Christian Couder <christian.couder@gmail.com> writes:
Show 22 quoted lines
> The mechanism to decide which blobs should be sent to which
> external object database will be very simple for now.
> If the external odb helper support any "put_*" instruction
> all the new blobs will be sent to it.
>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
> external-odb.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/external-odb.c b/external-odb.c
> index 82fac702e8..a4f8c72e1c 100644
> --- a/external-odb.c
> +++ b/external-odb.c
> @@ -124,6 +124,10 @@ int external_odb_put_object(const void *buf, size_t len,
> {
> struct odb_helper *o;
>
> + /* For now accept only blobs */
> + if (strcmp(type, "blob"))
> + return 1;
> +I somehow doubt that a policy decision like this should be made at this layer. Shouldn't it be encoded in the capability the other side supports, or determined at runtime per each individual object when a "put" is attempted (i.e. allow the other side to say "You tell me that you want me to store an object of type X and size Y; I cannot do that, sorry").
> external_odb_init();
>
> for (o = helpers; o; o = o->next) {