Skip to content

Virtualization of the refs API

Michael Haggerty git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest38 patches 10 repliesIn review
  2. v138 patches 28 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/38resolve_gitlink_ref(): eliminate temporary variablerefs/files-backend.c+2 -30 replies
2/38rename_ref_available(): add docstringrefs.c refs/refs-internal.h+17 -72 replies
3/38refs: rename struct ref_cache to files_ref_storerefs/files-backend.c+63 -630 replies
4/38refs: add a backend method structurerefs.c refs.h refs/files-backend.c +1 more+34 -01 reply
5/38refs: create a base class "ref_store" for files_ref_storerefs.c refs/files-backend.c refs/refs-internal.h+270 -784 replies
6/38add_packed_ref(): add a files_ref_store argumentrefs/files-backend.c+5 -40 replies
7/38get_packed_ref(): add a files_ref_store argumentrefs/files-backend.c+9 -70 replies
8/38resolve_missing_loose_ref(): add a files_ref_store argumentrefs/files-backend.c+6 -60 replies
9/38{lock,commit,rollback}_packed_refs(): add files_ref_store argumentsrefs/files-backend.c+16 -160 replies
10/38refs: add a transaction_commit() methodrefs.c refs/files-backend.c refs/refs-internal.h+20 -40 replies
11/38refs: reorder definitionsrefs/files-backend.c+83 -830 replies
12/38resolve_packed_ref(): rename function from resolve_missing_loose_ref()refs/files-backend.c+5 -60 replies
13/38resolve_gitlink_packed_ref(): remove functionrefs/files-backend.c+5 -210 replies
14/38read_raw_ref(): take a (struct ref_store *) argumentrefs.c refs/files-backend.c refs/refs-internal.h+22 -90 replies
15/38resolve_ref_recursively(): new functionrefs.c+11 -30 replies
16/38resolve_gitlink_ref(): implement using resolve_ref_recursively()refs.c refs/files-backend.c+24 -670 replies
17/38resolve_gitlink_ref(): avoid memory allocation in many casesrefs.c+13 -60 replies
18/38resolve_gitlink_ref(): rename path parameter to submodulerefs.c refs.h+12 -100 replies
19/38refs: make read_raw_ref() virtualrefs.c refs/files-backend.c refs/refs-internal.h+29 -250 replies
20/38refs: make verify_refname_available() virtualrefs.c refs/files-backend.c refs/refs-internal.h+25 -60 replies
21/38refs: make pack_refs() virtualrefs.c refs/files-backend.c refs/refs-internal.h+15 -20 replies
22/38refs: make create_symref() virtualrefs.c refs/files-backend.c refs/refs-internal.h+20 -10 replies
23/38refs: make peel_ref() virtualrefs.c refs/files-backend.c refs/refs-internal.h+14 -20 replies
24/38repack_without_refs(): add a files_ref_store argumentrefs/files-backend.c+7 -50 replies
25/38lock_raw_ref(): add a files_ref_store argumentrefs/files-backend.c+8 -60 replies
26/38commit_ref_update(): add a files_ref_store argumentrefs/files-backend.c+8 -60 replies
27/38lock_ref_for_update(): add a files_ref_store argumentrefs/files-backend.c+6 -50 replies
28/38lock_ref_sha1_basic(): add a files_ref_store argumentrefs/files-backend.c+15 -110 replies
29/38split_symref_update(): add a files_ref_store argumentrefs/files-backend.c+4 -20 replies
30/38files_ref_iterator_begin(): take a ref_store argumentrefs.c refs/files-backend.c refs/refs-internal.h+7 -70 replies
31/38refs: add method iterator_beginrefs.c refs/files-backend.c refs/refs-internal.h+15 -140 replies
32/38refs: add methods for reflogrefs.c refs/files-backend.c refs/refs-internal.h+150 -270 replies
33/38refs: add method for initial ref transaction commitrefs.c refs/files-backend.c refs/refs-internal.h+14 -30 replies
34/38refs: make delete_refs() virtualrefs.c refs/files-backend.c refs/refs-internal.h+14 -20 replies
35/38refs: add methods to init refs dbbuiltin/init-db.c refs.c refs.h +2 more+42 -100 replies
36/38refs: add method to rename refsrefs.c refs/files-backend.c refs/refs-internal.h+17 -180 replies
37/38refs: make lock genericrefs/files-backend.c refs/refs-internal.h+14 -130 replies
38/38refs: implement iteration over only per-worktree refsrefs/files-backend.c refs/refs-internal.h+13 -11 reply

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 00/38] Virtualization of the refs API

This is v2 of the patch series to virtualize the references API (though earlier patch series similar in spirit were submitted by Ronnie Sahlberg and David Turner). Thanks to Junio, Eric, and Ramsay for their comments about v1 [1].

Nobody pointed out any fundamental problems with v1, but this version includes the following improvements:

* In "rename_ref_available(): add docstring":

* Improve docstring as suggested by Junio.

* In "refs: create a base class "ref_store" for files_ref_store":

* Let main_ref_store and submodule_ref_stores be initialized implicitly rather than initializing them explicitly to NULL.

* Add docstrings for those two variables.

* Eliminate a temporary variable in files_downcast().

* In "resolve_gitlink_ref(): avoid memory allocation in many cases":

* Instead of keeping track of orig_len, after stripping off any trailing slashes check whether path[len - 1] is NUL.

* In "refs: add methods for reflog":

* Don't export files_reflog_iterator_begin() (suggested by Ramsay).

In addition, given that v1 was pretty old, I have rebased the patch series against the current upstream master. (The rebase was unproblematic.)

This patch series is also available from my GitHub fork [2] as branch "ref-store".

Michael

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

David Turner (8):
rename_ref_available(): add docstring
refs: add methods for reflog
refs: add method for initial ref transaction commit
refs: make delete_refs() virtual
refs: add methods to init refs db
refs: add method to rename refs
refs: make lock generic
refs: implement iteration over only per-worktree refs

Michael Haggerty (28):
resolve_gitlink_ref(): eliminate temporary variable
refs: rename struct ref_cache to files_ref_store
refs: create a base class "ref_store" for files_ref_store add_packed_ref(): add a files_ref_store argument get_packed_ref(): add a files_ref_store argument resolve_missing_loose_ref(): add a files_ref_store argument {lock,commit,rollback}_packed_refs(): add files_ref_store arguments
refs: reorder definitions
resolve_packed_ref(): rename function from resolve_missing_loose_ref() resolve_gitlink_packed_ref(): remove function read_raw_ref(): take a (struct ref_store *) argument resolve_ref_recursively(): new function resolve_gitlink_ref(): implement using resolve_ref_recursively() resolve_gitlink_ref(): avoid memory allocation in many cases resolve_gitlink_ref(): rename path parameter to submodule
refs: make read_raw_ref() virtual
refs: make verify_refname_available() virtual
refs: make pack_refs() virtual
refs: make create_symref() virtual
refs: make peel_ref() virtual
repack_without_refs(): add a files_ref_store argument lock_raw_ref(): add a files_ref_store argument commit_ref_update(): add a files_ref_store argument lock_ref_for_update(): add a files_ref_store argument lock_ref_sha1_basic(): add a files_ref_store argument split_symref_update(): add a files_ref_store argument files_ref_iterator_begin(): take a ref_store argument
refs: add method iterator_begin

Ronnie Sahlberg (2):
refs: add a backend method structure
refs: add a transaction_commit() method

 builtin/init-db.c    |  21 +-
 refs.c               | 309 +++++++++++++++++++++++++++-
 refs.h               |  13 +-
 refs/files-backend.c | 566 +++++++++++++++++++++++++++------------------------
 refs/refs-internal.h | 220 +++++++++++++++++---
 5 files changed, 812 insertions(+), 317 deletions(-)
Signature · 1 line
2.9.3