git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:01 UTC

Re: [PATCH] unpack-trees: use explicit repository in trace2 calls

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 31, 2026, 05:31 UTC
Message-ID
<actcHT_ZHkb58ndi@pks.im>
In-Reply-To
<pull.2258.git.git.1774901607564.gitgitgadget@gmail.com>
On Mon, Mar 30, 2026 at 08:13:27PM +0000, Jayesh Daga via GitGitGadget wrote:
Show 14 quoted lines
> From: Jayesh Daga <jayeshdaga99@gmail.com>
> diff --git a/unpack-trees.c b/unpack-trees.c
> index 998a1e6dc7..191b9d4769 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -1903,7 +1903,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
>  		BUG("o->df_conflict_entry is an output only field");
>  
>  	trace_performance_enter();
> -	trace2_region_enter("unpack_trees", "unpack_trees", the_repository);
> +	trace2_region_enter("unpack_trees", "unpack_trees", repo);
>  
>  	prepare_repo_settings(repo);
>  	if (repo->settings.command_requires_full_index) {

The changes in `unpack_trees()` are a bit misleading -- while it reads as if we don't use `the_repository` anymore, we still do because the function starts with:

  int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options *o)
  {
  	struct repository *repo = the_repository;

So would it make sense to maybe have a separate patch where we inject a repository as a parameter to `unpack_trees()`?

Once that's done we only have a handful of other places, and in all but two cases we have a repository available via the index. Do we maybe want to go all the way so that we can drop `USE_THE_REPOSITORY_VARIABLE` at the end of this series?

Thanks!
Patrick
Previous: Jayesh Daga via GitGitGadgetNext: Junio C Hamano
Message 2 of 9 in “unpack-trees: use explicit repository in trace2 calls”
  1. unpack-trees: use explicit repository in trace2 callsJayesh Daga via GitGitGadget, Mar 30, 2026
  2. Patrick SteinhardtMar 31, 2026
  3. Junio C HamanoMar 31, 2026
  4. 0/2 unpack-trees: use explicit repository in trace2 callsJayesh Daga via GitGitGadget, Mar 31, 2026
  5. 1/2 unpack-trees: use repository from index instead of globalJayesh Daga via GitGitGadget, Mar 31, 2026
  6. 2/2 unpack-trees: use repository from index instead of globalJayesh Daga via GitGitGadget, Mar 31, 2026
  7. Junio C HamanoMar 31, 2026
  8. Junio C HamanoMar 31, 2026
  9. Junio C HamanoJun 9, 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.