Skip to content

Separate `ref_cache` into a separate module

Michael Haggerty git 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest20 patches 0 repliesNew
  2. v220 patches 21 repliesSuperseded
  3. v120 patches 17 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20get_ref_dir(): don't call read_loose_refs() for "refs/bisect"refs/files-backend.c+0 -20 replies
2/20refs_read_raw_ref(): new functionrefs.c refs/refs-internal.h+13 -20 replies
3/20refs_ref_iterator_begin(): new functionrefs.c refs/refs-internal.h+24 -20 replies
4/20refs_verify_refname_available(): implement once for all backendsrefs.c refs.h refs/files-backend.c +1 more+92 -410 replies
5/20refs_verify_refname_available(): use function in more placesrefs/files-backend.c+11 -1600 replies
6/20ref-cache: rename `add_ref()` to `add_ref_entry()`refs/files-backend.c+4 -40 replies
7/20ref-cache: rename `find_ref()` to `find_ref_entry()`refs/files-backend.c+3 -30 replies
8/20ref-cache: rename `remove_entry()` to `remove_entry_from_dir()`refs/files-backend.c+2 -20 replies
9/20refs: split `ref_cache` code into separate filesMakefile refs/files-backend.c refs/ref-cache.c +1 more+767 -7330 replies
10/20ref-cache: introduce a new type, ref_cacherefs/files-backend.c refs/ref-cache.c refs/ref-cache.h+46 -130 replies
11/20refs: record the ref_store in ref_cache, not ref_dirrefs/files-backend.c refs/ref-cache.c refs/ref-cache.h+16 -110 replies
12/20ref-cache: use a callback function to fill the cacherefs/files-backend.c refs/ref-cache.c refs/ref-cache.h+38 -130 replies
13/20refs: handle "refs/bisect/" in `loose_fill_ref_dir()`refs/files-backend.c refs/ref-cache.c+15 -160 replies
14/20do_for_each_entry_in_dir(): eliminate `offset` argumentrefs/files-backend.c refs/ref-cache.c refs/ref-cache.h+10 -110 replies
15/20get_loose_ref_dir(): function renamed from get_loose_refs()refs/files-backend.c+3 -30 replies
16/20get_loose_ref_cache(): new functionrefs/files-backend.c+7 -20 replies
17/20cache_ref_iterator_begin(): make function smarterrefs/files-backend.c refs/ref-cache.c refs/ref-cache.h+56 -530 replies
18/20commit_packed_refs(): use reference iterationrefs/files-backend.c+17 -210 replies
19/20files_pack_refs(): use reference iterationrefs/files-backend.c+60 -830 replies
20/20do_for_each_entry_in_dir(): delete functionrefs/ref-cache.c refs/ref-cache.h+0 -320 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 00/20] Separate `ref_cache` into a separate module

This is v3 of a patch series to separate the reference caching code into a separate module that interacts with files_ref_cache more at arm's length. Thanks to Stefan and Duy for their feedback about v2 [1].

This version has only minor changes since v2 (and indeed since v1 [2]):

* Rebased onto the current nd/files-backend-git-dir (there were no conflicts).

* Removed redundant assignment in

refs_verify_refname_available(): implement once for all backends

* Improved two commit messages.

This patch series is also available from my GitHub fork [3] as branch "separate-ref-cache". These patches depend on Duy's nd/files-backend-git-dir branch.

[1] http://public-inbox.org/git/[email protected]/
[2] http://public-inbox.org/git/[email protected]/
[3] https://github.com/mhagger/git

Michael Haggerty (20):
get_ref_dir(): don't call read_loose_refs() for "refs/bisect" refs_read_raw_ref(): new function refs_ref_iterator_begin(): new function refs_verify_refname_available(): implement once for all backends refs_verify_refname_available(): use function in more places
ref-cache: rename add_ref() to add_ref_entry()
ref-cache: rename find_ref() to find_ref_entry()
ref-cache: rename remove_entry() to remove_entry_from_dir()
refs: split ref_cache code into separate files
ref-cache: introduce a new type, ref_cache
refs: record the ref_store in ref_cache, not ref_dir
ref-cache: use a callback function to fill the cache
refs: handle "refs/bisect/" in loose_fill_ref_dir() do_for_each_entry_in_dir(): eliminate offset argument get_loose_ref_dir(): function renamed from get_loose_refs() get_loose_ref_cache(): new function cache_ref_iterator_begin(): make function smarter commit_packed_refs(): use reference iteration files_pack_refs(): use reference iteration do_for_each_entry_in_dir(): delete function

 Makefile             |    1 +
 refs.c               |  111 ++++-
 refs.h               |    2 +-
 refs/files-backend.c | 1229 +++++++-------------------------------------------
 refs/ref-cache.c     |  523 +++++++++++++++++++++
 refs/ref-cache.h     |  267 +++++++++++
 refs/refs-internal.h |   22 +-
 7 files changed, 1066 insertions(+), 1089 deletions(-)
 create mode 100644 refs/ref-cache.c
 create mode 100644 refs/ref-cache.h
Signature · 1 line
2.11.0