git/Documentation/technical
Tian Yuchen 508ec9837c repository: move fetch_if_missing into struct repository
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.

builtin/fetch-pack.c, builtin/fsck.c, and builtin/rev-list.c are
entered via commands marked RUN_SETUP in git.c:commands[]. Their
'repo' parameter is only NULL when '-h' is given outside of a
repository, in which case either show_usage_if_asked() or
parse_options()'s own '-h' handling exits the process before
returning. We can therefore drop their UNUSED markers and assign
to 'repo' directly.

builtin/index-pack.c is entered via RUN_SETUP_GENTLY, so its
'repo' pointer can be NULL any time it is run outside of a
repository, not only with '-h'. We keep a NULL check there and fall
back to 'the_repository'.

builtin/pack-objects.c needs two adjustments to make 'repo' reach
every 'fetch_if_missing' call site: 'read_stdin_packs()' now takes a
'struct repository *'; 'option_parse_missing_action()', which
is registered as an OPT_CALLBACK, receives a 'repo' through the
option's 'value' field now.

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

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Ayush Chandekar <ayu.chandekar@gmail.com>
Mentored-by: Olamide Caleb Bello <belkid98@gmail.com>
Signed-off-by: Tian Yuchen <cat@malon.dev>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-15 08:37:54 -07:00
..
.gitignore
api-error-handling.adoc
api-index-skel.adoc
api-index.sh
api-merge.adoc
api-parse-options.adoc parse-options: rename `OPT_MAGNITUDE()` to `OPT_UNSIGNED()` 2025-04-17 08:15:15 -07:00
api-path-walk.adoc path-walk: always emit directly-requested objects 2026-05-24 18:41:06 +09:00
api-simple-ipc.adoc doc: *.txt -> *.adoc fixes 2025-03-03 13:49:21 -08:00
api-trace2.adoc doc: replace git config --list/-l with `list` 2026-04-06 09:57:07 -07:00
bitmap-format.adoc
build-systems.adoc doc: fix typos via codespell 2026-06-08 00:21:35 +09:00
bundle-uri.adoc bundle-uri: copy all bundle references ino the refs/bundle space 2025-04-25 13:36:45 -07:00
commit-graph.adoc doc: commit-graph.adoc: fix up some formatting 2025-10-16 13:55:52 -07:00
directory-rename-detection.adoc
hash-function-transition.adoc doc: fix typo in GIT_ALTERNATE_OBJECT_DIRECTORIES 2026-06-06 11:04:03 +09:00
large-object-promisors.adoc doc: add large-object-promisors.adoc to the docs build 2025-10-16 13:55:53 -07:00
long-running-process-protocol.adoc doc: check well-formedness of delimited sections 2025-08-11 14:16:03 -07:00
meson.build Merge branch 'en/xdiff-cleanup-2' 2025-12-05 14:49:56 +09:00
multi-pack-index.adoc Documentation: describe incremental MIDX bitmaps 2025-03-21 04:33:28 -07:00
pack-heuristics.adoc
packfile-uri.adoc
parallel-checkout.adoc
partial-clone.adoc repository: move fetch_if_missing into struct repository 2026-08-15 08:37:54 -07:00
platform-support.adoc
racy-git.adoc
reftable.adoc
remembering-renames.adoc doc: remembering-renames.adoc: fix asciidoc warnings 2025-10-16 13:55:52 -07:00
repository-version.adoc
rerere.adoc
scalar.adoc
send-pack-pipeline.adoc
shallow.adoc
sparse-checkout.adoc doc: sparse-checkout.adoc: fix asciidoc warnings 2025-10-16 13:55:52 -07:00
sparse-index.adoc
trivial-merge.adoc
unambiguous-types.adoc doc: define unambiguous type mappings across C and Rust 2025-11-18 14:53:09 -08:00
unit-tests.adoc