git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/4] Build in git-repack

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 8, 2013, 02:44 UTC
Message-ID
<CACsJy8D3FL0rG9YHuSOtobNffiqffU6J7_gfc85CiGuwUdRNnQ@mail.gmail.com>
In-Reply-To
<7v38qlec2w.fsf@alter.siamese.dyndns.org>
On Wed, Aug 7, 2013 at 10:48 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 33 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> [ It's cool you're working on this, I'd really like a git-repack in C.
>>   That would fix this
>>   http://thread.gmane.org/gmane.comp.version-control.git/226458 ]
>>
>> Stefan Beller <stefanbeller@googlemail.com> writes:
>>
>>> From: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>>>
>>> pack-objects learns a few more options to take over what's been done
>>> by git-repack.sh. cmd_repack() becomes a wrapper around
>>> cmd_pack_objects().
>>
>> I think the patch would read easier if these were split into two
>> patches: one doing the real stuff in pack-objects, and then getting rid
>> of git-repack.sh to replace it with a trivial built-in.
>>
>> Actually, I'm wondering why pack-objects requires so much changes.
>> git-repack.sh was already a relatively small wrapper around
>> pack-objects, and did not need the new options you add, so why are they
>> needed? In particular adding the new --update-info option that just does
>>
>>> +    if (repack_flags & REPACK_UPDATE_INFO)
>>> +            update_server_info(0);
>>
>> seems overkill to me: why don't you just let cmd_repack call
>> update_server_info(0)?
>
> My feeling exactly.  I would rather see a patch that does not touch
> pack-objects at all, and use run_command() interface to spawn it.
> Once we do have to pack, the necessary processing cycle will dwarf
> the fork/exec latency anyway, no?

I'm not opposed to run_command(). I think the reason I wanted to move repack functionality to pack-objects is to avoid reading sha-1 from pack-objects and reconstruct the paths again from the sha-1. But for simplicity, perhaps we should not touch pack-objects at all. Then we could have builtin/repack.c instead of stuffing cmd_repack in builtin/pack-objects.c

@Stefan, if you want to push this work, feel free to take it as _your_ patch, rewrite as will. You don't need to retain my name.

-- 
Duy
Previous: Stefan BellerNext: Stefan Beller
Message 11 of 17 in “Rewriting git-repack.sh in C”
  1. Stefan BellerAug 2, 2013
  2. Duy NguyenAug 2, 2013
  3. Duy NguyenAug 2, 2013
  4. Fredrik GustafssonAug 3, 2013
  5. Duy NguyenAug 3, 2013
  6. 0/4 Re: Rewriting git-repack.sh in CStefan Beller, Aug 7, 2013
  7. 1/4 Build in git-repackStefan Beller, Aug 7, 2013
  8. Matthieu MoyAug 7, 2013
  9. Junio C HamanoAug 7, 2013
  10. Stefan BellerAug 7, 2013
  11. Duy NguyenAug 8, 2013
  12. 2/4 backup_file dummy functionStefan Beller, Aug 7, 2013
  13. Duy NguyenAug 8, 2013
  14. 3/4 pack-objects: do not print usage when repackingStefan Beller, Aug 7, 2013
  15. Antoine PelisseAug 8, 2013
  16. 4/4 repack: add unpack-unreachableStefan Beller, Aug 7, 2013
  17. Matthieu MoyAug 5, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.