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

[PATCH 00/16] refs: drop all references to `the_repository`

From
Patrick Steinhardt <ps@pks.im>
Date
May 16, 2024, 08:04 UTC
Message-ID
<cover.1715836916.git.ps@pks.im>
Hi,

in "ps/refs-without-the-repository", we have removed all functions in the refs API that could be trivially converted to accept a proper ref store as input. This was a mechanical change, and because the resulting patches were quite large by themselves already, I decided to push out further dependencies on `the_repository` in refs-related code to a follow up.

This patch series here is that follow-up and removes all references to `the_repository` in "refs.c" and "refs/". This includes both explicit use of `the_repository`, but also implicit use via `the_hash_algo`.

The series is based on 19fe900cfc (The fourth batch, 2024-05-15) and pulls in "ps/refs-without-the-repository" at c8f815c208 (refs: remove functions without ref store, 2024-05-07) as dependency. It applies cleanly to both next and seen at the current point in time.

Patrick
Patrick Steinhardt (16):
  refs: adjust names for `init` and `init_db` callbacks
  refs: rename `init_db` callback to avoid confusion
  refs: implement releasing ref storages
  refs: track ref stores via strmap
  refs: pass repo when retrieving submodule ref store
  refs: refactor `resolve_gitlink_ref()` to accept a repository
  refs: retrieve worktree ref stores via associated repository
  refs: convert iteration over replace refs to accept ref store
  refs: pass ref store when detecting dangling symrefs
  refs: move object peeling into "object.c"
  refs: pass repo when peeling objects
  refs: drop `git_default_branch_name()`
  refs: remove `dwim_log()`
  refs/files: use correct repository
  refs/files: remove references to `the_hash_algo`
  refs/packed: remove references to `the_hash_algo`
 attr.c                      |   3 +-
 builtin/clone.c             |   5 +-
 builtin/describe.c          |   2 +-
 builtin/fetch.c             |   3 +-
 builtin/gc.c                |   2 +-
 builtin/pack-objects.c      |   6 +-
 builtin/reflog.c            |   2 +-
 builtin/remote.c            |   3 +-
 builtin/repack.c            |   2 +-
 builtin/replace.c           |  13 +-
 builtin/show-ref.c          |   2 +-
 builtin/submodule--helper.c |  14 +-
 builtin/update-index.c      |   5 +-
 builtin/var.c               |   2 +-
 builtin/worktree.c          |   2 +-
 combine-diff.c              |   3 +-
 commit-graph.c              |   2 +-
 diff-lib.c                  |   3 +-
 dir.c                       |   3 +-
 ls-refs.c                   |   2 +-
 midx-write.c                |   2 +-
 object-file.c               |   2 +-
 object.c                    |  23 ++++
 object.h                    |  35 +++++
 read-cache.c                |   5 +-
 ref-filter.c                |   2 +-
 reflog-walk.c               |   4 +-
 reflog.c                    |   2 +-
 refs.c                      | 266 ++++++++++--------------------------
 refs.h                      |  51 +++----
 refs/debug.c                |  15 +-
 refs/files-backend.c        |  58 ++++----
 refs/iterator.c             |   6 +-
 refs/packed-backend.c       |  66 +++++----
 refs/packed-backend.h       |   6 +-
 refs/ref-cache.c            |   5 +-
 refs/refs-internal.h        |  55 ++------
 refs/reftable-backend.c     |  38 +++++-
 remote.c                    |  12 +-
 replace-object.c            |  10 +-
 repository.c                |  12 ++
 repository.h                |  14 ++
 setup.c                     |   7 +-
 submodule.c                 |   3 +-
 t/helper/test-reach.c       |   2 +-
 t/helper/test-ref-store.c   |   2 +-
 tag.c                       |   4 +-
 tag.h                       |   2 +-
 unpack-trees.c              |   3 +-
 upload-pack.c               |   2 +-
 worktree.c                  |   2 +
 worktree.h                  |   2 +
 52 files changed, 405 insertions(+), 392 deletions(-)
-- 
2.45.1.190.g19fe900cfc.dirty
Next: Patrick Steinhardt
Message 1 of 33 in “refs: drop all references to `the_repository`”
  1. 00/16 refs: drop all references to `the_repository`Patrick Steinhardt, May 16, 2024
  2. 01/16 refs: adjust names for `init` and `init_db` callbacksPatrick Steinhardt, May 16, 2024
  3. Karthik NayakMay 16, 2024
  4. 02/16 refs: rename `init_db` callback to avoid confusionPatrick Steinhardt, May 16, 2024
  5. Karthik NayakMay 16, 2024
  6. Junio C HamanoMay 16, 2024
  7. Patrick SteinhardtMay 17, 2024
  8. 03/16 refs: implement releasing ref storagesPatrick Steinhardt, May 16, 2024
  9. Karthik NayakMay 16, 2024
  10. Junio C HamanoMay 16, 2024
  11. Patrick SteinhardtMay 17, 2024
  12. Patrick SteinhardtMay 17, 2024
  13. 04/16 refs: track ref stores via strmapPatrick Steinhardt, May 16, 2024
  14. Junio C HamanoMay 16, 2024
  15. 05/16 refs: pass repo when retrieving submodule ref storePatrick Steinhardt, May 16, 2024
  16. Junio C HamanoMay 16, 2024
  17. Patrick SteinhardtMay 17, 2024
  18. 06/16 refs: refactor `resolve_gitlink_ref()` to accept a repositoryPatrick Steinhardt, May 16, 2024
  19. Junio C HamanoMay 16, 2024
  20. 07/16 refs: retrieve worktree ref stores via associated repositoryPatrick Steinhardt, May 16, 2024
  21. 08/16 refs: convert iteration over replace refs to accept ref storePatrick Steinhardt, May 16, 2024
  22. 09/16 refs: pass ref store when detecting dangling symrefsPatrick Steinhardt, May 16, 2024
  23. 10/16 refs: move object peeling into "object.c"Patrick Steinhardt, May 16, 2024
  24. Junio C HamanoMay 16, 2024
  25. 11/16 refs: pass repo when peeling objectsPatrick Steinhardt, May 16, 2024
  26. 12/16 refs: drop `git_default_branch_name()`Patrick Steinhardt, May 16, 2024
  27. Karthik NayakMay 16, 2024
  28. 13/16 refs: remove `dwim_log()`Patrick Steinhardt, May 16, 2024
  29. 14/16 refs/files: use correct repositoryPatrick Steinhardt, May 16, 2024
  30. 15/16 refs/files: remove references to `the_hash_algo`Patrick Steinhardt, May 16, 2024
  31. 16/16 refs/packed: remove references to `the_hash_algo`Patrick Steinhardt, May 16, 2024
  32. Karthik NayakMay 16, 2024
  33. Patrick SteinhardtMay 17, 2024

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.