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

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

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Sep 4, 2016, 16:08 UTC
Message-ID
<cover.1473003902.git.mhagger@alum.mit.edu>

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/cover.1464983301.git.mhagger@alum.mit.edu/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(-)
-- 
2.9.3
Next: Michael Haggerty
Message 1 of 49 in “Virtualization of the refs API”
  1. 00/38 Virtualization of the refs APIMichael Haggerty, Sep 4, 2016
  2. 06/38 add_packed_ref(): add a files_ref_store argumentMichael Haggerty, Sep 4, 2016
  3. 02/38 rename_ref_available(): add docstringMichael Haggerty, Sep 4, 2016
  4. Jakub NarębskiSep 6, 2016
  5. Michael HaggertySep 7, 2016
  6. 01/38 resolve_gitlink_ref(): eliminate temporary variableMichael Haggerty, Sep 4, 2016
  7. 04/38 refs: add a backend method structureMichael Haggerty, Sep 4, 2016
  8. David TurnerSep 4, 2016
  9. 07/38 get_packed_ref(): add a files_ref_store argumentMichael Haggerty, Sep 4, 2016
  10. 14/38 read_raw_ref(): take a (struct ref_store *) argumentMichael Haggerty, Sep 4, 2016
  11. 10/38 refs: add a transaction_commit() methodMichael Haggerty, Sep 4, 2016
  12. 03/38 refs: rename struct ref_cache to files_ref_storeMichael Haggerty, Sep 4, 2016
  13. 16/38 resolve_gitlink_ref(): implement using resolve_ref_recursively()Michael Haggerty, Sep 4, 2016
  14. 18/38 resolve_gitlink_ref(): rename path parameter to submoduleMichael Haggerty, Sep 4, 2016
  15. 08/38 resolve_missing_loose_ref(): add a files_ref_store argumentMichael Haggerty, Sep 4, 2016
  16. 31/38 refs: add method iterator_beginMichael Haggerty, Sep 4, 2016
  17. 35/38 refs: add methods to init refs dbMichael Haggerty, Sep 4, 2016
  18. 38/38 refs: implement iteration over only per-worktree refsMichael Haggerty, Sep 4, 2016
  19. David TurnerSep 8, 2016
  20. 32/38 refs: add methods for reflogMichael Haggerty, Sep 4, 2016
  21. 33/38 refs: add method for initial ref transaction commitMichael Haggerty, Sep 4, 2016
  22. 29/38 split_symref_update(): add a files_ref_store argumentMichael Haggerty, Sep 4, 2016
  23. 37/38 refs: make lock genericMichael Haggerty, Sep 4, 2016
  24. 30/38 files_ref_iterator_begin(): take a ref_store argumentMichael Haggerty, Sep 4, 2016
  25. 22/38 refs: make create_symref() virtualMichael Haggerty, Sep 4, 2016
  26. 15/38 resolve_ref_recursively(): new functionMichael Haggerty, Sep 4, 2016
  27. 27/38 lock_ref_for_update(): add a files_ref_store argumentMichael Haggerty, Sep 4, 2016
  28. 36/38 refs: add method to rename refsMichael Haggerty, Sep 4, 2016
  29. 26/38 commit_ref_update(): add a files_ref_store argumentMichael Haggerty, Sep 4, 2016
  30. 28/38 lock_ref_sha1_basic(): add a files_ref_store argumentMichael Haggerty, Sep 4, 2016
  31. 34/38 refs: make delete_refs() virtualMichael Haggerty, Sep 4, 2016
  32. 12/38 resolve_packed_ref(): rename function from resolve_missing_loose_ref()Michael Haggerty, Sep 4, 2016
  33. 13/38 resolve_gitlink_packed_ref(): remove functionMichael Haggerty, Sep 4, 2016
  34. 19/38 refs: make read_raw_ref() virtualMichael Haggerty, Sep 4, 2016
  35. 25/38 lock_raw_ref(): add a files_ref_store argumentMichael Haggerty, Sep 4, 2016
  36. 11/38 refs: reorder definitionsMichael Haggerty, Sep 4, 2016
  37. 17/38 resolve_gitlink_ref(): avoid memory allocation in many casesMichael Haggerty, Sep 4, 2016
  38. 24/38 repack_without_refs(): add a files_ref_store argumentMichael Haggerty, Sep 4, 2016
  39. 20/38 refs: make verify_refname_available() virtualMichael Haggerty, Sep 4, 2016
  40. 05/38 refs: create a base class "ref_store" for files_ref_storeMichael Haggerty, Sep 4, 2016
  41. David TurnerSep 4, 2016
  42. Michael HaggertySep 5, 2016
  43. Stefan BellerSep 5, 2016
  44. David TurnerSep 5, 2016
  45. 09/38 {lock,commit,rollback}_packed_refs(): add files_ref_store argumentsMichael Haggerty, Sep 4, 2016
  46. 21/38 refs: make pack_refs() virtualMichael Haggerty, Sep 4, 2016
  47. 23/38 refs: make peel_ref() virtualMichael Haggerty, Sep 4, 2016
  48. Junio C HamanoSep 7, 2016
  49. Michael HaggertySep 8, 2016

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.