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

Re: [PATCH v3 04/11] promisor-remote: add promisor_remote_reinit()

From
Christian Couder <christian.couder@gmail.com>
Date
Apr 1, 2019, 16:41 UTC
Message-ID
<CAP8UFD1n9=DH-AA+7u10Xk=7Rs3Kq+Bn4AdyxoG+cu2_pOQKvA@mail.gmail.com>
In-Reply-To
<xmqqlg1je6uk.fsf@gitster-ct.c.googlers.com>
On Wed, Mar 13, 2019 at 5:28 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
>
> Christian Couder <christian.couder@gmail.com> writes:
>
> > From: Christian Couder <christian.couder@gmail.com>
> >
> > We will need to reinitialize the promisor remote configuration
> > as we will make some changes to it in a later commit.
> >
> > Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> > ---
>
> At this point, turning "initialized" into a file-scope static, and
> building reinit as
>
>         void promisor_remote_reinit(void)
>         {
>                 initialized = 0;
>                 ... clear existing "promisor" entries ...
>                 promisor_remote_init();
>         }
>
> may make more sense.
Ok, I implemented that.
Show 15 quoted lines
> > -static void promisor_remote_init(void)
> > +static void promisor_remote_do_init(int force)
> >  {
> >       static int initialized;
> >
> > -     if (initialized)
> > +     if (!force && initialized)
> >               return;
> >       initialized = 1;
> >
> >       git_config(promisor_remote_config, NULL);
>
> The promisors and promisors_tail would need to be reinitiazlied and
> existing elements on the list purged.  Otherwise, after removing an
> entry from the configuration file, the entry will still stay around.
Yeah, that's in the new version too.
> >  }
Previous: Junio C HamanoNext: Christian Couder
Message 12 of 22 in “Many promisor remotes”
  1. 00/11 Many promisor remotesChristian Couder, Mar 12, 2019
  2. 01/11 fetch-object: make functions return an error codeChristian Couder, Mar 12, 2019
  3. 03/11 promisor-remote: implement promisor_remote_get_direct()Christian Couder, Mar 12, 2019
  4. Junio C HamanoMar 13, 2019
  5. Christian CouderApr 1, 2019
  6. 02/11 Add initial support for many promisor remotesChristian Couder, Mar 12, 2019
  7. Junio C HamanoMar 13, 2019
  8. Junio C HamanoMar 13, 2019
  9. Christian CouderApr 1, 2019
  10. 04/11 promisor-remote: add promisor_remote_reinit()Christian Couder, Mar 12, 2019
  11. Junio C HamanoMar 13, 2019
  12. Christian CouderApr 1, 2019
  13. 05/11 promisor-remote: use repository_format_partial_cloneChristian Couder, Mar 12, 2019
  14. Junio C HamanoMar 13, 2019
  15. Christian CouderApr 1, 2019
  16. Junio C HamanoApr 1, 2019
  17. 07/11 promisor-remote: parse remote.*.partialclonefilterChristian Couder, Mar 12, 2019
  18. 08/11 builtin/fetch: remove unique promisor remote limitationChristian Couder, Mar 12, 2019
  19. 06/11 Use promisor_remote_get_direct() and has_promisor_remote()Christian Couder, Mar 12, 2019
  20. 09/11 t0410: test fetching from many promisor remotesChristian Couder, Mar 12, 2019
  21. 10/11 partial-clone: add multiple remotes in the docChristian Couder, Mar 12, 2019
  22. 11/11 remote: add promisor and partial clone config to the docChristian Couder, Mar 12, 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.