[PATCH/RFC 0/2] close packs files when they are not needed
- From
Max Kirillov <max@max630.net>
- Date
- Oct 1, 2015, 03:29 UTC
- Message-ID
- <1443670163-31193-1-git-send-email-max@max630.net>
- In-Reply-To
- <xmqqlhbn7ky1.fsf@gitster.mtv.corp.google.com>
> The right approach may to have a helper in sha1_file.c that closes > and cleans up _all_ packs, and call it from here, instead of having > builtin/clone.c even know about implementation details such as > packed_git is a linked list, etc.
Like this?
Note I did not test it to actually work for the current code. Trying now what I could do with lsof, just to be sure myself, but probably its use not appropriate for the project.
Max Kirillov (2): sha1_file: close all pack files after running sha1_file: set packfile to O_CLOEXEC at open
builtin/pack-objects.c | 2 +- cache.h | 3 +- git.c | 2 ++ pack-bitmap.c | 2 +- sha1_file.c | 80 +++++++++++++++++++++++++++++++++++--------------- 5 files changed, 63 insertions(+), 26 deletions(-)
-- 2.3.4.2801.g3d0809b