All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/38] Virtualization of the refs API
@ 2016-06-03 21:03 Michael Haggerty
  2016-06-03 21:03 ` [PATCH 01/38] resolve_gitlink_ref(): eliminate temporary variable Michael Haggerty
                   ` (38 more replies)
  0 siblings, 39 replies; 67+ messages in thread
From: Michael Haggerty @ 2016-06-03 21:03 UTC (permalink / raw)
  To: Junio C Hamano, David Turner
  Cc: Ramsay Jones, Eric Sunshine, Jeff King,
	Nguyễn Thái Ngọc Duy, git, Michael Haggerty

Since the that ref-iterator [1] changes seem to have gotten a positive
reception, let's try to keep up the momentum. I hope I'm not
overloading the review pipeline...

I think all of the groundwork is in place now to virtualize the refs
API. This will open the way to storing refs in ways other than the
familiar loose refs / packed refs format, such as David Turner's
proposed LMDB-based storage [2].

This is a long patch series, but most of the patches are pretty simple
and formulaic. The goal is to implement a `ref_store`. In the language
of object-oriented programming, `ref_store` is an abstract base class
representing a reference storage backend. It provides methods to read,
write, and delete references and symrefs, and to iterate over
references, reflogs, and reflog entries, plus a number of other
things—19 methods in all.

The one concrete implementation of this class is files_ref_store,
which implements the traditional loose/packed refs scheme with
caching. After this patch series, about the only things left in
`refs/files-backend.c` with external linkage are vtables.

On these 19 methods are built the refs API as used by the rest of Git.
The OO interface is not exposed; instead, the OO implementation is
wrapped in traditional C functions. In fact, this patch series doesn't
change the existing public interface at all, and adds only two new
functions!

Somebody who wants to implement a new way to store references needs to
implement a new class derived from `ref_store`, including its 19
methods, plus one or two supporting ref_iterator classes, and wire it
up to be instantiated when needed.

This patch series opens up a lot of possibilities for improving the
internal design of the files backend; I've described some of my plans
in recent emails [3,4]. But that can be done separately; for now, the
main point of this series is to clear the way for LMDB-based reference
storage.

This patch series owes a lot to Ronnie Sahlberg and David Turner, who
wrote earlier drafts along the same basic lines. The current patch
series differs from theirs in many details of where exactly to draw
the line of abstraction. But the most important difference in my
opinion is that this series allows multiple ref_stores of different
types to coexist. I think this is important for the UI (for example,
if somebody converts a submodule to use a different reference storage
scheme than the umbrella repository uses), but also because it allows
ref_stores to be compounded together internally to decrease the
coupling between different parts of the system. I've tried to retain
their authorship of any patches that are more or less recognizable
from their versions (hopefully without introducing any bugs!) But the
spirit of their versions permeates this patch series. Thanks a lot to
both of you!

This series applies on top of the "ref-iterator v2" series that I just
submitted [1]. It can also be obtained from my GitHub repo [5] as
branch "ref-store".

Michael

[1] http://thread.gmane.org/gmane.comp.version-control.git/296322
[2] http://thread.gmane.org/gmane.comp.version-control.git/286572
[3] http://thread.gmane.org/gmane.comp.version-control.git/295961/focus=296096
[4] http://thread.gmane.org/gmane.comp.version-control.git/295961/focus=296186
[5] 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: add method for delete_refs
  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               | 294 +++++++++++++++++++++++++-
 refs.h               |  13 +-
 refs/files-backend.c | 567 +++++++++++++++++++++++++++------------------------
 refs/refs-internal.h | 213 +++++++++++++++++--
 5 files changed, 799 insertions(+), 309 deletions(-)

-- 
2.8.1

^ permalink raw reply	[flat|nested] 67+ messages in thread

end of thread, other threads:[~2016-07-13 15:30 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-03 21:03 [PATCH 00/38] Virtualization of the refs API Michael Haggerty
2016-06-03 21:03 ` [PATCH 01/38] resolve_gitlink_ref(): eliminate temporary variable Michael Haggerty
2016-06-03 21:03 ` [PATCH 02/38] rename_ref_available(): add docstring Michael Haggerty
2016-06-07 18:10   ` Junio C Hamano
2016-06-09 13:09     ` Michael Haggerty
2016-06-09 15:08       ` Junio C Hamano
2016-06-03 21:03 ` [PATCH 03/38] refs: rename struct ref_cache to files_ref_store Michael Haggerty
2016-06-03 21:03 ` [PATCH 04/38] refs: add a backend method structure Michael Haggerty
2016-06-03 21:03 ` [PATCH 05/38] refs: create a base class "ref_store" for files_ref_store Michael Haggerty
2016-06-07 16:31   ` Junio C Hamano
2016-06-09 21:54     ` René Scharfe
2016-06-07 17:03   ` Junio C Hamano
2016-06-09 14:10     ` Michael Haggerty
2016-06-09 16:14       ` Junio C Hamano
2016-06-10  6:18         ` Michael Haggerty
2016-06-10 15:53           ` Junio C Hamano
2016-06-10  8:08   ` Eric Sunshine
2016-06-10 12:02     ` Michael Haggerty
2016-06-03 21:03 ` [PATCH 06/38] add_packed_ref(): add a files_ref_store argument Michael Haggerty
2016-06-03 21:03 ` [PATCH 07/38] get_packed_ref(): " Michael Haggerty
2016-06-03 21:03 ` [PATCH 08/38] resolve_missing_loose_ref(): " Michael Haggerty
2016-06-03 21:03 ` [PATCH 09/38] {lock,commit,rollback}_packed_refs(): add files_ref_store arguments Michael Haggerty
2016-06-03 21:03 ` [PATCH 10/38] refs: add a transaction_commit() method Michael Haggerty
2016-06-03 21:03 ` [PATCH 11/38] refs: reorder definitions Michael Haggerty
2016-06-03 21:03 ` [PATCH 12/38] resolve_packed_ref(): rename function from resolve_missing_loose_ref() Michael Haggerty
2016-06-03 21:03 ` [PATCH 13/38] resolve_gitlink_packed_ref(): remove function Michael Haggerty
2016-06-03 21:03 ` [PATCH 14/38] read_raw_ref(): take a (struct ref_store *) argument Michael Haggerty
2016-06-03 21:03 ` [PATCH 15/38] resolve_ref_recursively(): new function Michael Haggerty
2016-06-03 21:03 ` [PATCH 16/38] resolve_gitlink_ref(): implement using resolve_ref_recursively() Michael Haggerty
2016-06-07 17:19   ` Junio C Hamano
2016-06-14  5:03   ` Eric Sunshine
2016-06-16  4:03     ` Michael Haggerty
2016-06-03 21:03 ` [PATCH 17/38] resolve_gitlink_ref(): avoid memory allocation in many cases Michael Haggerty
2016-06-07 17:29   ` Junio C Hamano
2016-06-09 14:37     ` Michael Haggerty
2016-06-03 21:03 ` [PATCH 18/38] resolve_gitlink_ref(): rename path parameter to submodule Michael Haggerty
2016-06-03 21:03 ` [PATCH 19/38] refs: make read_raw_ref() virtual Michael Haggerty
2016-06-03 21:03 ` [PATCH 20/38] refs: make verify_refname_available() virtual Michael Haggerty
2016-06-03 21:03 ` [PATCH 21/38] refs: make pack_refs() virtual Michael Haggerty
2016-06-07 17:35   ` Junio C Hamano
2016-06-09 14:46     ` Michael Haggerty
2016-06-03 21:03 ` [PATCH 22/38] refs: make create_symref() virtual Michael Haggerty
2016-06-03 21:03 ` [PATCH 23/38] refs: make peel_ref() virtual Michael Haggerty
2016-06-07 17:36   ` Junio C Hamano
2016-06-09 15:05     ` Michael Haggerty
2016-06-03 21:03 ` [PATCH 24/38] repack_without_refs(): add a files_ref_store argument Michael Haggerty
2016-06-03 21:04 ` [PATCH 25/38] lock_raw_ref(): " Michael Haggerty
2016-06-03 21:04 ` [PATCH 26/38] commit_ref_update(): " Michael Haggerty
2016-06-03 21:04 ` [PATCH 27/38] lock_ref_for_update(): " Michael Haggerty
2016-06-03 21:04 ` [PATCH 28/38] lock_ref_sha1_basic(): " Michael Haggerty
2016-06-03 21:04 ` [PATCH 29/38] split_symref_update(): " Michael Haggerty
2016-06-03 21:04 ` [PATCH 30/38] files_ref_iterator_begin(): take a ref_store argument Michael Haggerty
2016-06-03 21:04 ` [PATCH 31/38] refs: add method iterator_begin Michael Haggerty
2016-06-03 21:04 ` [PATCH 32/38] refs: add methods for reflog Michael Haggerty
2016-06-03 21:04 ` [PATCH 33/38] refs: add method for initial ref transaction commit Michael Haggerty
2016-06-03 21:04 ` [PATCH 34/38] refs: add method for delete_refs Michael Haggerty
2016-06-07 17:43   ` Junio C Hamano
2016-06-09 15:14     ` Michael Haggerty
2016-06-03 21:04 ` [PATCH 35/38] refs: add methods to init refs db Michael Haggerty
2016-06-03 21:04 ` [PATCH 36/38] refs: add method to rename refs Michael Haggerty
2016-06-03 21:04 ` [PATCH 37/38] refs: make lock generic Michael Haggerty
2016-06-07 17:50   ` Junio C Hamano
2016-06-09 15:21     ` Michael Haggerty
2016-06-09 15:53     ` Michael Haggerty
2016-06-03 21:04 ` [PATCH 38/38] refs: implement iteration over only per-worktree refs Michael Haggerty
2016-07-10 15:09 ` [PATCH 00/38] Virtualization of the refs API Duy Nguyen
2016-07-13 15:26   ` Michael Haggerty

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.