Re: [PATCH 7/9] commit-graph: stop using `the_hash_algo`
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Aug 4, 2025, 22:10 UTC
- Message-ID
- <aJEvzR4wuve/9ltU@nand.local>
- In-Reply-To
- <20250804-b4-pks-commit-graph-wo-the-repository-v1-7-850d626eb2e8@pks.im>
On Mon, Aug 04, 2025 at 10:17:23AM +0200, Patrick Steinhardt wrote:
> Stop using `the_hash_algo` as it implicitly relies on `the_repository`. > Instead, we either use the hash algo provided via the context or, if > there is no such hash algo, we use `the_repository` explicitly. Such > uses will be removed in subsequent commits.
Seems reasonable, and the implementation looks straightforward to me, however I wonder...
Show 6 quoted lines
> @@ -129,6 +130,7 @@ struct repo_settings; > * prior to calling parse_commit_graph(). > */ > struct commit_graph *parse_commit_graph(struct repo_settings *s, > + const struct git_hash_algo *hash_algo, > void *graph_map, size_t graph_size);
...does it make more sense to take a 'struct repository *' here instead of passing both its settings and hash_algo separately? Is there a scenario where we would want to parse a commit graph with a (settings, hash_algo) pair that does not match that of any single repository?
Thanks, Taylor