Thread (1 message) 1 message, 1 author, 2025-04-28

Re: [PATCH v2 06/13] treewide: trivial conversions of `repo_has_object_file()`

From: Junio C Hamano <hidden>
Date: 2025-04-28 21:40:29

Patrick Steinhardt [off-list ref] writes:
As the comment of `repo_has_object_file()` and its `_with_flags()`
variant tells us, these functions are considered to be deprecated in
favor of `has_object()`. The benefit of the replacement is better
defaults: it doesn't fetch missing objects via promisor remotes, and
neither does it reload packfiles if an object wasn't found by default.
The reason why the "better default" being "better" is not clear to
readers of this paragraph.

It would be better if too many places need to pass an extra flag to
disable lazy fetching in the current code, for example, in which
case we would instead have fewer very selected places that would
pass an extra flag to lazily fetch (or even better, see has_object()
fail and then invoke a lazy fetch themselves) while majority of
places would just work with the plain vanilla local repository state
without having to worry about lazy fetching at all.  Without
explaining why it is a "better default", it is a bit hard to justify
"the benefit of the replacement".

This is common to this and the previous step.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help