git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5 04/16] promisor-remote: implement promisor_remote_get_direct()

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 30, 2019, 20:46 UTC
Message-ID
<nycvar.QRO.7.76.6.1905302235000.44@tvgsbejvaqbjf.bet>
In-Reply-To
<b4d69d2b-dc0d-fffb-2909-c54060fe9cd1@gmail.com>
Hi,
On Thu, 30 May 2019, Derrick Stolee wrote:
Show 16 quoted lines
> On 4/9/2019 12:11 PM, Christian Couder wrote:
> > From: Christian Couder <christian.couder@gmail.com>
> >
> > +{
> > +	int i, missing_nr = 0;
> > +	int *missing = xcalloc(oid_nr, sizeof(*missing));
> > +	struct object_id *old_oids = *oids;
> > +	struct object_id *new_oids;
> > +	int old_fetch_if_missing = fetch_if_missing;
> > +
> > +	fetch_if_missing = 0;
>
> This global 'fetch_if_missing' swap seems very fragile. I'm guessing you
> are using it to prevent a loop when calling oid_object_info_extended()
> below. Can you instead pass a flag to the method that disables the
> fetch_if_missing behavior?

FWIW I mentioned the very same concern here: https://public-inbox.org/git/nycvar.QRO.7.76.6.1903272300020.41@tvgsbejvaqbjf.bet/

The situation is *pretty* bad by now. I see `fetch_if_missing` mentioned 25 times in `master`, and all but one are in .c files or in cache.h.

The flag is actually used only in `oid_object_info_extended()`, and that function accepts an `unsigned flags`, so one might think that it could be extended to accept also a `OBJECT_INFO_LOOKUP_FETCH_IF_MISSING`. But then, there are many callers of that function, some of them also pretty low in the food chain. For example, `oid_object_info()` (does not accept `flags`) or `read_object()` (does not accept flags either).

So it looks as if the idea to pass this flag down the call chain entailed a pretty serious avalanche effect.

An alternative that strikes me as inelegant, still, but nevertheless better would be to move `fetch_if_missing` into `struct repository`.

Ciao, Dscho

Previous: Derrick StoleeNext: Derrick Stolee
Message 9 of 28 in “Many promisor remotes”
  1. 00/16 Many promisor remotesChristian Couder, Apr 9, 2019
  2. 01/16 t0410: remove pipes after git commandsChristian Couder, Apr 9, 2019
  3. 02/16 fetch-object: make functions return an error codeChristian Couder, Apr 9, 2019
  4. 03/16 Add initial support for many promisor remotesChristian Couder, Apr 9, 2019
  5. 05/16 promisor-remote: add promisor_remote_reinit()Christian Couder, Apr 9, 2019
  6. 06/16 promisor-remote: use repository_format_partial_cloneChristian Couder, Apr 9, 2019
  7. 04/16 promisor-remote: implement promisor_remote_get_direct()Christian Couder, Apr 9, 2019
  8. Derrick StoleeMay 30, 2019
  9. Johannes SchindelinMay 30, 2019
  10. Derrick StoleeMay 30, 2019
  11. Johannes SchindelinMay 31, 2019
  12. Junio C HamanoMay 31, 2019
  13. Christian CouderMay 31, 2019
  14. Christian CouderJun 25, 2019
  15. 07/16 Use promisor_remote_get_direct() and has_promisor_remote()Christian Couder, Apr 9, 2019
  16. 08/16 diff: use promisor-remote.h instead of fetch-object.hChristian Couder, Apr 9, 2019
  17. 09/16 promisor-remote: parse remote.*.partialclonefilterChristian Couder, Apr 9, 2019
  18. 10/16 builtin/fetch: remove unique promisor remote limitationChristian Couder, Apr 9, 2019
  19. 12/16 partial-clone: add multiple remotes in the docChristian Couder, Apr 9, 2019
  20. 11/16 t0410: test fetching from many promisor remotesChristian Couder, Apr 9, 2019
  21. 13/16 remote: add promisor and partial clone config to the docChristian Couder, Apr 9, 2019
  22. 14/16 Remove fetch-object.{c,h} in favor of promisor-remote.{c,h}Christian Couder, Apr 9, 2019
  23. 15/16 Move repository_format_partial_clone to promisor-remote.cChristian Couder, Apr 9, 2019
  24. 16/16 Move core_partial_clone_filter_default to promisor-remote.cChristian Couder, Apr 9, 2019
  25. Junio C HamanoApr 15, 2019
  26. Junio C HamanoApr 15, 2019
  27. Christian CouderApr 15, 2019
  28. Christian CouderApr 15, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.