Re: [PATCH 0/4] wean start_command() off the_repository
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 11, 2026, 19:30 UTC
- Message-ID
- <xmqqo6kunoyl.fsf@gitster.g>
- In-Reply-To
- <20260311151923.4178655-1-bkkaracay@gmail.com>
Burak Kaan Karaçay <bkkaracay@gmail.com> writes:
Show 19 quoted lines
> start_command() relies on the_repository due to the 'close_object_store' > flag in 'struct child_process'. Introduce repo_start_command() to allow > working with arbitrary repositories. Turn start_command() into a macro > that wraps repo_start_command() and migrate the existing callers with a > cocci script. > > For callers that cannot access 'the_repository' due to the lack of > USE_THE_REPOSITORY_VARIABLE, define the macro. If the caller already has > a local repository context, pass it explicitly instead of defining the > macro. > > Thanks, > Burak Kaan Karaçay > > Burak Kaan Karaçay (4): > run-command: add repo_start_command() > run-command: use repo_start_command() in strict callers > run-command: redefine start_command() as a wrapper macro > cocci: convert start_command() to repo_start_command()
The organization to start with a wrapper, and then moving to a macro that is protected behind USE_THE_REPOSITORY_VARIABLE, makes quite a lot of sense. I do not know the answer to the question I asked on "don't we need to know from which repository we are closing the object store while switching to this new repository?", and without knowing the answer, we cannot quite decide what the function signature of repo_start_command() should look like, so the last step might be a bit premature.
Other than that, a well reasoned series.
Thanks.