Thread (130 messages) 130 messages, 5 authors, 2018-03-26

Re: [PATCH 44/44] packfile: keep prepare_packed_git() private

From: Jonathan Tan <hidden>
Date: 2018-03-19 20:34:43

On Sat,  3 Mar 2018 18:36:37 +0700
Nguyễn Thái Ngọc Duy  [off-list ref] wrote:
The reason callers have to call this is to make sure either packed_git
or packed_git_mru pointers are initialized since we don't do that by
default. Sometimes it's hard to see this connection between where the
function is called and where packed_git pointer is used (sometimes in
separate functions).

Keep this dependency internal because now all access to packed_git and
packed_git_mru must go through get_xxx() wrappers.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
The patches up to and including this one look good.

I also see that the question I asked in patch 10 about lazily
initializing some fields is answered here.

If we're planning to avoid making the user call prepare_packed_git()
(which I agree with), I think we also need to ensure that we always use
the get_xxx() wrapper whenever we access objects.packed_git. Currently,
there are still some functions in packfile.c that do not do so (notably
for_each_packed_object()). Could these be changed too? (This should not
be too difficult for you to do on your own, but I can send a fixup
patch if you want.)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help