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

Re: [Outreachy PATCH] negotiator/default: stop using the_repository

From
Christian Couder <christian.couder@gmail.com>
Date
Nov 3, 2026, 11:50 UTC
Message-ID
<CAP8UFD1BW7qEWp87j+7B12d=eOu80Yv1=Gf+ibEriV9s=4umag@mail.gmail.com>
In-Reply-To
<20261027153429.14131-1-okhuomonajayi54@gmail.com>

On Tue, Oct 27, 2026 at 4:37 PM Okhuomon Ajayi <okhuomonajayi54@gmail.com> wrote:

Show 8 quoted lines
>  static void have_sent(struct fetch_negotiator *n, struct commit *c)
>  {
> -       if (repo_parse_commit(the_repository, c))
> +       struct negotiation_state *ns = n->data;
> +
> +       if (repo_parse_commit(ns->repo, c))
>                 return;
>         mark_common(n->data, c, 0, 0);
As you introduced `ns`, you might use it to simplify the above line using:
         mark_common(ns, c, 0, 0);
>  }
[...]
> -void default_negotiator_init(struct fetch_negotiator *negotiator);
> +void default_negotiator_init(struct fetch_negotiator *negotiator,
> +                            struct repository *r);

Many functions have their `struct repository *r` argument as their first argument. Is there a reason why you prefered to have it as the second argument?

Thanks.
Previous: Okhuomon AjayiNext: Okhuomon Ajayi
Message 2 of 4 in “negotiator/default: stop using the_repository”
  1. negotiator/default: stop using the_repositoryOkhuomon Ajayi, Oct 27, 2026
  2. Christian CouderNov 3, 2026
  3. Okhuomon AjayiNov 3, 2026
  4. negotiator/default: stop using the_repositoryOkhuomon Ajayi, Nov 3, 2026

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.