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

Re: [GSoC][PATCH v2 0/5] Add refs optimize subcommand

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 8, 2025, 14:07 UTC
Message-ID
<xmqq348xyr5b.fsf@gitster.g>
In-Reply-To
<20250906075147.1076656-1-meetsoni3017@gmail.com>
Meet Soni <meetsoni3017@gmail.com> writes:
> This series introduces `git refs optimize` as a modern replacement for
> `git pack-refs`, continuing the effort to consolidate commands
> under the `git refs` namespace.

Sorry, but I do not quite see the point of this change. Is it your goal to eventually remove "git pack-refs"?

I would very much understand if this were:
    "git pack-refs" is a command that is very specific to the files
    backend to optimize the way refs are stored in that backend.  It
    does not do anything to other backends.
    Introduce "git refs optimize" as the end-user facing front-end
    so that later different backends, including reftable backend,
    can define their own way to optimize the way refs are stored in
    them.  As the first step, switch on what backend is in use in
    the repository, and invoke "git pack-refs" if the repository
    uses the files backend.

And when framed this way, I am not sure it is a good direction forward to have pack-refs.[ch] top-level files. I have to wonder if the approach should be more along this line?

 - Define the "optimize" action in the refs API.  What it really
   means to "optimize" may differ from backend to backend.  There
   may be refs_optimize(struct ref_store *refs) API entry point.
 - Add the new action to the vtable for refs backends.  There may be
   no action defined for reftable backend for now, or you may find
   there already are reftable specific optimizations you want to
   trigger from there.
 - Figure out how this interacts with existing refs_pack_refs();
   most likely it as the backend specific option, should go away,
   and its implementation would move to the "optimize" action driven
   from the vtable for files backend.

Once it is done, you do not necessarily need "git refs optimize", but the "git pack-refs" could be the front-end to trigger the more generic "optimize" action. In other words, in a repository whose refs are stored in reftable, "git pack-refs" would cease to be a no-op but can perform optimizations suitable in that repository.

That way, users do not need to learn a new command, which may be also an advantage over what is being proposed here.

Thanks.
Previous: Meet SoniNext: Junio C Hamano
Message 8 of 36 in “Add refs optimize subcommand”
  1. Meet SoniSep 6, 2025
  2. [GSoC][PATCH v2 1/5] builtin/pack-refs: factor out core logic into a shared libraryMeet Soni, Sep 6, 2025
  3. [GSoC][PATCH v2 2/5] doc: factor out common optionMeet Soni, Sep 6, 2025
  4. Junio C HamanoSep 8, 2025
  5. [GSoC][PATCH v2 3/5] builtin/refs: add optimize subcommandMeet Soni, Sep 6, 2025
  6. [GSoC][PATCH v2 4/5] t0601: refactor tests to be shareableMeet Soni, Sep 6, 2025
  7. [GSoC][PATCH v2 5/5] t: add test for git refs optimize subcommandMeet Soni, Sep 6, 2025
  8. Junio C HamanoSep 8, 2025
  9. Junio C HamanoSep 8, 2025
  10. [GSoC][PATCH v3 0/9] Add refs optimize subcommandMeet Soni, Sep 18, 2025
  11. [GSoC][PATCH v3 1/9] refs: add a generic 'optimize' APIMeet Soni, Sep 18, 2025
  12. shejialuoSep 18, 2025
  13. Junio C HamanoSep 18, 2025
  14. [GSoC][PATCH v3 2/9] files-backend: implement 'optimize' actionMeet Soni, Sep 18, 2025
  15. [GSoC][PATCH v3 3/9] reftable-backend: implement 'optimize' actionMeet Soni, Sep 18, 2025
  16. [GSoC][PATCH v3 4/9] builtin/pack-refs: convert to use the generic refs_optimize() APIMeet Soni, Sep 18, 2025
  17. shejialuoSep 18, 2025
  18. [GSoC][PATCH v3 5/9] builtin/pack-refs: factor out core logic into a shared libraryMeet Soni, Sep 18, 2025
  19. [GSoC][GSoC][PATCH v3 6/9] doc: pack-refs: factor out common optionsMeet Soni, Sep 18, 2025
  20. [GSoC][PATCH v3 7/9] builtin/refs: add optimize subcommandMeet Soni, Sep 18, 2025
  21. Junio C HamanoSep 18, 2025
  22. [GSoC][PATCH v3 8/9] t0601: refactor tests to be shareableMeet Soni, Sep 18, 2025
  23. [GSoC][PATCH v3 9/9] t: add test for git refs optimize subcommandMeet Soni, Sep 18, 2025
  24. [GSoC][PATCH v4 0/9] Add refs optimize subcommandMeet Soni, Sep 19, 2025
  25. [GSoC][PATCH v4 1/9] refs: add a generic 'optimize' APIMeet Soni, Sep 19, 2025
  26. Patrick SteinhardtSep 24, 2025
  27. [GSoC][PATCH v4 2/9] files-backend: implement 'optimize' actionMeet Soni, Sep 19, 2025
  28. [GSoC][PATCH v4 3/9] reftable-backend: implement 'optimize' actionMeet Soni, Sep 19, 2025
  29. [GSoC][PATCH v4 4/9] builtin/pack-refs: convert to use the generic refs_optimize() APIMeet Soni, Sep 19, 2025
  30. [GSoC][PATCH v4 5/9] builtin/pack-refs: factor out core logic into a shared libraryMeet Soni, Sep 19, 2025
  31. Patrick SteinhardtSep 24, 2025
  32. [GSoC][PATCH v4 6/9] doc: pack-refs: factor out common optionsMeet Soni, Sep 19, 2025
  33. [GSoC][PATCH v4 7/9] builtin/refs: add optimize subcommandMeet Soni, Sep 19, 2025
  34. [GSoC][PATCH v4 8/9] t0601: refactor tests to be shareableMeet Soni, Sep 19, 2025
  35. [GSoC][PATCH v4 9/9] t: add test for git refs optimize subcommandMeet Soni, Sep 19, 2025
  36. Junio C HamanoSep 19, 2025

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.