Re: [PATCH v5 10/40] Add initial external odb support

From
Jeff King <hidden>
Date
2017-08-03 20:17:44
Reply to
Junio C Hamano, 2017-08-03
On Thu, Aug 03, 2017 at 12:34:25PM -0700, Junio C Hamano wrote:
quoted
+int external_odb_get_object(const unsigned char *sha1)
+{
+	struct odb_helper *o;
+	const char *path;
+
+	if (!external_odb_has_object(sha1))
+		return -1;
This probably would not matter, as I do not expect one repository to
connect to and backed by very many external odb instances, but I
would have expected that the interaction would go more like "ah, we
need this object that is lacking locally. let's see if there is
anybody with the object. now we found who claims to have the object,
let's ask that guy (and nobody else) to give the object to us".

IOW, I would have expected two functions:

 - struct odb_helper *external_odb_with(struct object_id *oid);
 - int external_odb_get(struct object_id *oid, struct odb_helper *odb);
One advantage of walking through them linearly and asking "can you get
it?" is that it gracefully handles external odbs which aren't available.
That can be used for redundancy, or for situations where a preferred
odb isn't always available (e.g., a fast server which is only available
when you're on a particular network).

-Peff
Thread (3 messages) 3 messages, 3 authors, last reply 2017-09-14
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help