Thread (26 messages) flat view 26 messages, 3 authors, 1d ago

Re: [PATCH v2] repository: move fetch_if_missing into struct repository

From: Tian Yuchen <hidden>
Date: 2026-08-05 12:10:48

Hi Patrick,

On 8/4/26 16:24, Patrick Steinhardt wrote:
On Thu, Jul 16, 2026 at 03:29:54PM +0800, Tian Yuchen wrote:
quoted
The global variable 'fetch_if_missing' controls whether a missing
object check should prompt a lazy fetch from a promisor remote.
In order to continue the libification effort, move it into
'struct repository' and initialize it to 1 by default to keep the
previous behavior.

Note that in builtin/fsck.c and builtin/index-pack.c, when running
related commands with the '-h' parameter, the 'repo' pointer is not
passed in. To prevent null pointer dereferences, we defer
operations on the repo until after parameter parsing is complete.

Additionally, update the partial clone documentation to reflect
that this is now a per-repository flag.

Mentored-by: Christian Couder [off-list ref]
Mentored-by: Ayush Chandekar [off-list ref]
Mentored-by: Olamide Caleb Bello [off-list ref]
Signed-off-by: Tian Yuchen <redacted>
---

Change since V1:

- Following Patrick's advice, use the_repository whenever possible
   without re-introducing #define USE_THE_REPOSITORY_VARIABLE.
It would be great to include the range-diff compared to the previous
version so that it's easier for the reviewer to spot what's changed.
Tools like b4 automate this for you :)
I see, I will include it in the next reroll!

Thanks! yuchen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help