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

Re: [PATCH 1/3] commit-graph: pass a 'struct repository *' in more places

From
Derrick Stolee <stolee@gmail.com>
Date
Jun 30, 2020, 20:52 UTC
Message-ID
<00a3658e-323c-0719-5f26-4689e2a90374@gmail.com>
In-Reply-To
<4ea9933b50fe0bc2738ab0e0dc52a4f17c4a2cb4.1593536481.git.me@ttaylorr.com>
On 6/30/2020 1:17 PM, Taylor Blau wrote:
> In a future commit, some commit-graph internals will want access to
> 'r->settings', but we only have the 'struct object_directory *'
> corresponding to that repository.
It is good to use "struct repository *" more.
> Add an additional parameter to pass the repository around in more
> places. In the next patch, we will remove the object directory (and
> instead reference it with 'r->odb').

And this is a good reason why we need the repository here: we will need the settings AND odb.

Show 10 quoted lines
> diff --git a/commit-graph.h b/commit-graph.h
> index 3ba0da1e5f..03d848e168 100644
> --- a/commit-graph.h
> +++ b/commit-graph.h
> @@ -76,10 +76,12 @@ struct commit_graph {
>  };
>  
>  struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st,
> +						 struct repository *r,
>  						 struct object_directory *odb);

I suppose my only nit is that the struct repository pointer is not always the first parameter. I understand that you have grouped it where the 'odb' parameter is here, so perhaps that is fine.

Feel free to ignore this nit.

Thanks, -Stolee

Previous: Taylor BlauNext: Taylor Blau
Message 3 of 16 in “commit-graph: introduce 'core.useBloomFilters'”
  1. 0/3 commit-graph: introduce 'core.useBloomFilters'Taylor Blau, Jun 30, 2020
  2. 1/3 commit-graph: pass a 'struct repository *' in more placesTaylor Blau, Jun 30, 2020
  3. Derrick StoleeJun 30, 2020
  4. 2/3 t4216: fix broken '&&'-chainTaylor Blau, Jun 30, 2020
  5. Eric SunshineJun 30, 2020
  6. Taylor BlauJun 30, 2020
  7. Jeff KingJun 30, 2020
  8. Taylor BlauJun 30, 2020
  9. Jeff KingJun 30, 2020
  10. Eric SunshineJun 30, 2020
  11. Jeff KingJun 30, 2020
  12. 3/3 commit-graph: respect 'core.useBloomFilters'Taylor Blau, Jun 30, 2020
  13. Jeff KingJun 30, 2020
  14. Taylor BlauJun 30, 2020
  15. Jeff KingJun 30, 2020
  16. Taylor BlauAug 3, 2020

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.