{"thread":{"id":"51348","subject":"[PATCH 0/2] Add OBJECT_INFO_NO_FETCH_IF_MISSING flag","startedAt":"2019-06-20T08:30:50Z","lastAt":"2019-06-21T10:48:02Z","messageCount":10,"participants":["Christian Couder","Jeff King","Derrick Stolee","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"377629","messageId":"20190620083026.14524-1-chriscool@tuxfamily.org","threadId":"51348","inReplyTo":null,"subject":"[PATCH 0/2] Add OBJECT_INFO_NO_FETCH_IF_MISSING flag","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2019-06-20T08:30:24Z","receivedAt":"2019-06-20T08:30:50Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"In a review[1] of my \"many promisor remotes\" patch series[2] and in\nthe following thread, it was suggested that a flag should be passed to\ntell oid_object_info_extended() that it should not fetch objects from\npromisor remotes if they are missing, instead of using the ugly\nfetch_if_missing global.\n\nIt looks like the OBJECT_INFO_FOR_PREFETCH flag already exists but\nunfortunately conflates 2 separate things.\n\nThis patch series introduces OBJECT_INFO_NO_FETCH_IF_MISSING to\ndisambiguate the different meanings and then uses it instead of\nOBJECT_INFO_FOR_PREFETCH where it makes sense.\n\n1: https://public-inbox.org/git/b4d69d2b-dc0d-fffb-2909-c54060fe9cd1@gmail.com/\n2: https://public-inbox.org/git/20190409161116.30256-1-chriscool@tuxfamily.org/\n\nChristian Couder (2):\n  object-store: introduce OBJECT_INFO_NO_FETCH_IF_MISSING\n  sha1-file: use OBJECT_INFO_NO_FETCH_IF_MISSING\n\n object-store.h | 9 +++++++--\n sha1-file.c    | 2 +-\n 2 files changed, 8 insertions(+), 3 deletions(-)\n\n-- \n2.22.0\n\n"},{"id":"377630","messageId":"20190620083026.14524-2-chriscool@tuxfamily.org","threadId":"51348","inReplyTo":"20190620083026.14524-1-chriscool@tuxfamily.org","subject":"[PATCH 1/2] object-store: introduce OBJECT_INFO_NO_FETCH_IF_MISSING","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2019-06-20T08:30:25Z","receivedAt":"2019-06-20T08:30:54Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"The fetch_if_missing global variable should be replaced as much\nas possible by passing a flag to oid_object_info_extended().\n\nThe existing OBJECT_INFO_FOR_PREFETCH unfortunately conflates\nboth a \"no fetch if missing\" meaning with OBJECT_INFO_QUICK\nwhich is about retrying packed storage.\n\nLet's disambiguate that by adding a new explicit\nOBJECT_INFO_NO_FETCH_IF_MISSING flag.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n object-store.h | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/object-store.h b/object-store.h\nindex 272e01e452..02c1795d50 100644\n--- a/object-store.h\n+++ b/object-store.h\n@@ -277,10 +277,15 @@ struct object_info {\n #define OBJECT_INFO_IGNORE_LOOSE 16\n /*\n  * Do not attempt to fetch the object if missing (even if fetch_is_missing is\n- * nonzero). This is meant for bulk prefetching of missing blobs in a partial\n+ * nonzero).\n+ */\n+#define OBJECT_INFO_NO_FETCH_IF_MISSING 32\n+/*\n+ * This is meant for bulk prefetching of missing blobs in a partial\n  * clone. Implies OBJECT_INFO_QUICK.\n  */\n-#define OBJECT_INFO_FOR_PREFETCH (32 + OBJECT_INFO_QUICK)\n+#define OBJECT_INFO_FOR_PREFETCH \\\n+  (OBJECT_INFO_NO_FETCH_IF_MISSING + OBJECT_INFO_QUICK)\n \n int oid_object_info_extended(struct repository *r,\n \t\t\t     const struct object_id *,\n-- \n2.22.0\n\n"},{"id":"377631","messageId":"20190620083026.14524-3-chriscool@tuxfamily.org","threadId":"51348","inReplyTo":"20190620083026.14524-1-chriscool@tuxfamily.org","subject":"[PATCH 2/2] sha1-file: use OBJECT_INFO_NO_FETCH_IF_MISSING","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2019-06-20T08:30:26Z","receivedAt":"2019-06-20T08:30:55Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Currently the OBJECT_INFO_FOR_PREFETCH flag is used to check\nif we should fetch objects from promisor remotes when we\nhaven't found them elsewhere.\n\nNow that OBJECT_INFO_NO_FETCH_IF_MISSING exists, let's use\nit instead to be more correct in case this new flag is ever\nused without OBJECT_INFO_QUICK.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n sha1-file.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/sha1-file.c b/sha1-file.c\nindex ed5c50dac4..2116ff1e70 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -1379,7 +1379,7 @@ int oid_object_info_extended(struct repository *r, const struct object_id *oid,\n \t\t/* Check if it is a missing object */\n \t\tif (fetch_if_missing && repository_format_partial_clone &&\n \t\t    !already_retried && r == the_repository &&\n-\t\t    !(flags & OBJECT_INFO_FOR_PREFETCH)) {\n+\t\t    !(flags & OBJECT_INFO_NO_FETCH_IF_MISSING)) {\n \t\t\t/*\n \t\t\t * TODO Investigate having fetch_object() return\n \t\t\t * TODO error/success and stopping the music here.\n-- \n2.22.0\n\n"},{"id":"377632","messageId":"20190620084842.GB3952@sigill.intra.peff.net","threadId":"51348","inReplyTo":"20190620083026.14524-2-chriscool@tuxfamily.org","subject":"Re: [PATCH 1/2] object-store: introduce OBJECT_INFO_NO_FETCH_IF_MISSING","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-06-20T08:48:42Z","receivedAt":"2019-06-20T08:48:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 20, 2019 at 10:30:25AM +0200, Christian Couder wrote:\n\n> The fetch_if_missing global variable should be replaced as much\n> as possible by passing a flag to oid_object_info_extended().\n> \n> The existing OBJECT_INFO_FOR_PREFETCH unfortunately conflates\n> both a \"no fetch if missing\" meaning with OBJECT_INFO_QUICK\n> which is about retrying packed storage.\n> \n> Let's disambiguate that by adding a new explicit\n> OBJECT_INFO_NO_FETCH_IF_MISSING flag.\n\nI think this patch is obsoleted by Stolee's 31f5256c82 (sha1-file: split\nOBJECT_INFO_FOR_PREFETCH, 2019-05-28), which I think just made it to\nmaster in the last day or so.\n\nThere it's called OBJECT_INFO_SKIP_FETCH_OBJECT, so your 2/2 will need\nto be tweaked.\n\n-Peff\n"},{"id":"377633","messageId":"20190620085009.GC3952@sigill.intra.peff.net","threadId":"51348","inReplyTo":"20190620083026.14524-3-chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] sha1-file: use OBJECT_INFO_NO_FETCH_IF_MISSING","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-06-20T08:50:09Z","receivedAt":"2019-06-20T08:50:12Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 20, 2019 at 10:30:26AM +0200, Christian Couder wrote:\n\n> Currently the OBJECT_INFO_FOR_PREFETCH flag is used to check\n> if we should fetch objects from promisor remotes when we\n> haven't found them elsewhere.\n> \n> Now that OBJECT_INFO_NO_FETCH_IF_MISSING exists, let's use\n> it instead to be more correct in case this new flag is ever\n> used without OBJECT_INFO_QUICK.\n\nI said earlier that this one would need to be tweaked for the new\nupstream name. But actually, I think it is not necessary after Stolee's\npatch.\n\n-Peff\n"},{"id":"377655","messageId":"d88ac28b-638b-89c0-2bfb-634a0bb6ca4c@gmail.com","threadId":"51348","inReplyTo":"20190620085009.GC3952@sigill.intra.peff.net","subject":"Re: [PATCH 2/2] sha1-file: use OBJECT_INFO_NO_FETCH_IF_MISSING","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-06-20T12:39:47Z","receivedAt":"2019-06-20T12:39:51Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 6/20/2019 4:50 AM, Jeff King wrote:\n> On Thu, Jun 20, 2019 at 10:30:26AM +0200, Christian Couder wrote:\n> \n>> Currently the OBJECT_INFO_FOR_PREFETCH flag is used to check\n>> if we should fetch objects from promisor remotes when we\n>> haven't found them elsewhere.\n>>\n>> Now that OBJECT_INFO_NO_FETCH_IF_MISSING exists, let's use\n>> it instead to be more correct in case this new flag is ever\n>> used without OBJECT_INFO_QUICK.\n> \n> I said earlier that this one would need to be tweaked for the new\n> upstream name. But actually, I think it is not necessary after Stolee's\n> patch.\n\nYes, I believe that 31f5256c82  does an equivalent thing to the\ncombination of these patches.\n\nThanks,\n-Stolee\n\n"},{"id":"377658","messageId":"CAP8UFD1-=+32G2XYXARcXm8=hnqZwxa1Ev9nmaS=qfqKS7GSWQ@mail.gmail.com","threadId":"51348","inReplyTo":"d88ac28b-638b-89c0-2bfb-634a0bb6ca4c@gmail.com","subject":"Re: [PATCH 2/2] sha1-file: use OBJECT_INFO_NO_FETCH_IF_MISSING","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2019-06-20T14:08:00Z","receivedAt":"2019-06-20T14:08:14Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Thu, Jun 20, 2019 at 2:39 PM Derrick Stolee <stolee@gmail.com> wrote:\n>\n> On 6/20/2019 4:50 AM, Jeff King wrote:\n> > On Thu, Jun 20, 2019 at 10:30:26AM +0200, Christian Couder wrote:\n> >\n> >> Currently the OBJECT_INFO_FOR_PREFETCH flag is used to check\n> >> if we should fetch objects from promisor remotes when we\n> >> haven't found them elsewhere.\n> >>\n> >> Now that OBJECT_INFO_NO_FETCH_IF_MISSING exists, let's use\n> >> it instead to be more correct in case this new flag is ever\n> >> used without OBJECT_INFO_QUICK.\n> >\n> > I said earlier that this one would need to be tweaked for the new\n> > upstream name. But actually, I think it is not necessary after Stolee's\n> > patch.\n>\n> Yes, I believe that 31f5256c82  does an equivalent thing to the\n> combination of these patches.\n\nYeah, I agree. Thanks Stolee for having already fixed that, and sorry\nfor bothering everyone with this.\n\nChristian.\n"},{"id":"377699","messageId":"xmqq36k4m12g.fsf@gitster-ct.c.googlers.com","threadId":"51348","inReplyTo":"20190620083026.14524-1-chriscool@tuxfamily.org","subject":"Re: [PATCH 0/2] Add OBJECT_INFO_NO_FETCH_IF_MISSING flag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-06-20T20:52:39Z","receivedAt":"2019-06-20T20:52:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> In a review[1] of my \"many promisor remotes\" patch series[2] and in\n> the following thread, it was suggested that a flag should be passed to\n> tell oid_object_info_extended() that it should not fetch objects from\n> promisor remotes if they are missing, instead of using the ugly\n> fetch_if_missing global.\n>\n> It looks like the OBJECT_INFO_FOR_PREFETCH flag already exists but\n> unfortunately conflates 2 separate things.\n>\n> This patch series introduces OBJECT_INFO_NO_FETCH_IF_MISSING to\n> disambiguate the different meanings and then uses it instead of\n> OBJECT_INFO_FOR_PREFETCH where it makes sense.\n>\n> 1: https://public-inbox.org/git/b4d69d2b-dc0d-fffb-2909-c54060fe9cd1@gmail.com/\n> 2: https://public-inbox.org/git/20190409161116.30256-1-chriscool@tuxfamily.org/\n\nWhat commit did you base these two patches on?\n\n>\n> Christian Couder (2):\n>   object-store: introduce OBJECT_INFO_NO_FETCH_IF_MISSING\n>   sha1-file: use OBJECT_INFO_NO_FETCH_IF_MISSING\n>\n>  object-store.h | 9 +++++++--\n>  sha1-file.c    | 2 +-\n>  2 files changed, 8 insertions(+), 3 deletions(-)\n"},{"id":"377700","messageId":"xmqqy31wkm97.fsf@gitster-ct.c.googlers.com","threadId":"51348","inReplyTo":"CAP8UFD1-=+32G2XYXARcXm8=hnqZwxa1Ev9nmaS=qfqKS7GSWQ@mail.gmail.com","subject":"Re: [PATCH 2/2] sha1-file: use OBJECT_INFO_NO_FETCH_IF_MISSING","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-06-20T20:57:56Z","receivedAt":"2019-06-20T20:58:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> On Thu, Jun 20, 2019 at 2:39 PM Derrick Stolee <stolee@gmail.com> wrote:\n>>\n>> On 6/20/2019 4:50 AM, Jeff King wrote:\n>> > On Thu, Jun 20, 2019 at 10:30:26AM +0200, Christian Couder wrote:\n>> >\n>> >> Currently the OBJECT_INFO_FOR_PREFETCH flag is used to check\n>> >> if we should fetch objects from promisor remotes when we\n>> >> haven't found them elsewhere.\n>> >>\n>> >> Now that OBJECT_INFO_NO_FETCH_IF_MISSING exists, let's use\n>> >> it instead to be more correct in case this new flag is ever\n>> >> used without OBJECT_INFO_QUICK.\n>> >\n>> > I said earlier that this one would need to be tweaked for the new\n>> > upstream name. But actually, I think it is not necessary after Stolee's\n>> > patch.\n>>\n>> Yes, I believe that 31f5256c82  does an equivalent thing to the\n>> combination of these patches.\n>\n> Yeah, I agree. Thanks Stolee for having already fixed that, and sorry\n> for bothering everyone with this.\n\nOK, I'll stop looking at this patch.\n"},{"id":"377738","messageId":"CAP8UFD0HsD+q2Srd7iUkPhXMHzUN=g0he3EHGd0m3n_TDxuZ1w@mail.gmail.com","threadId":"51348","inReplyTo":"xmqq36k4m12g.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 0/2] Add OBJECT_INFO_NO_FETCH_IF_MISSING flag","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2019-06-21T10:47:48Z","receivedAt":"2019-06-21T10:48:02Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Thu, Jun 20, 2019 at 10:52 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Christian Couder <christian.couder@gmail.com> writes:\n>\n> > In a review[1] of my \"many promisor remotes\" patch series[2] and in\n> > the following thread, it was suggested that a flag should be passed to\n> > tell oid_object_info_extended() that it should not fetch objects from\n> > promisor remotes if they are missing, instead of using the ugly\n> > fetch_if_missing global.\n> >\n> > It looks like the OBJECT_INFO_FOR_PREFETCH flag already exists but\n> > unfortunately conflates 2 separate things.\n> >\n> > This patch series introduces OBJECT_INFO_NO_FETCH_IF_MISSING to\n> > disambiguate the different meanings and then uses it instead of\n> > OBJECT_INFO_FOR_PREFETCH where it makes sense.\n> >\n> > 1: https://public-inbox.org/git/b4d69d2b-dc0d-fffb-2909-c54060fe9cd1@gmail.com/\n> > 2: https://public-inbox.org/git/20190409161116.30256-1-chriscool@tuxfamily.org/\n>\n> What commit did you base these two patches on?\n\nThey were based on master at v2.22.0 when I worked on them, but I\ndidn't send them right away. And I didn't rebase them before I later\nsent them.\n"}]}