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

[PATCH v2 0/9] Store submodules in a hash, not a linked list

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Feb 10, 2017, 11:16 UTC
Message-ID
<cover.1486724698.git.mhagger@alum.mit.edu>

This is v2 of the patch series, considerably reorganized but not that different codewise. Thanks to Stefan, Junio, and Peff for their feedback about v1 [1]. I think I have addressed all of your comments.

Changes since v1:
* Rebase from `master` onto `maint` (to match Junio).
* Reorder some commits to make the presentation more logical.
* Added an explicit preparatory commit that just reorders some
  function definitions, because it makes the diff for the subsequent
  commit a lot easier to read.
* Make some preexisting functions private:
  * lookup_ref_store()
  * ref_store_init()
* Remove some unnecessary handling of `submodule == ""` when it is
  already known to have been converted to `NULL`. (Some of the
  purported handling also happened to be broken.)
* Introduce function `register_ref_store()` in a separate step, before
  switching to hashmaps.
* Don't initialize hashmap in `lookup_ref_store()`. (Just return
  `NULL`; the hashmap will be initialized in `register_ref_store()` a
  moment later.)
* Make code in `submodule_hash_cmp()` clearer.
* Use `FLEX_ALLOC_STR()` in `alloc_submodule_hash_entry()`.
* Don't specify an initial size for the submodule hashmap (the default
  is OK).

This patch series is also available from my fork on GitHub [2] as branch "submodule-hash".

Michael

[1] http://public-inbox.org/git/cover.1486629195.git.mhagger@alum.mit.edu/T/#u [2] https://github.com/mhagger/git

Michael Haggerty (9):
  refs: reorder some function definitions
  refs: make some ref_store lookup functions private
  refs: remove some unnecessary handling of submodule == ""
  register_ref_store(): new function
  refs: store submodule ref stores in a hashmap
  refs: push the submodule attribute down
  base_ref_store_init(): remove submodule argument
  files_ref_store::submodule: use NULL for the main repository
  read_loose_refs(): read refs using resolve_ref_recursively()
 refs.c               | 107 +++++++++++++++++++++++++++++++++++----------------
 refs/files-backend.c |  77 +++++++++++++++++++++---------------
 refs/refs-internal.h |  48 ++++-------------------
 3 files changed, 127 insertions(+), 105 deletions(-)
-- 
2.9.3
Next: Michael Haggerty
Message 1 of 18 in “Store submodules in a hash, not a linked list”
  1. 0/9 Store submodules in a hash, not a linked listMichael Haggerty, Feb 10, 2017
  2. 2/9 refs: make some ref_store lookup functions privateMichael Haggerty, Feb 10, 2017
  3. 7/9 base_ref_store_init(): remove submodule argumentMichael Haggerty, Feb 10, 2017
  4. 9/9 read_loose_refs(): read refs using resolve_ref_recursively()Michael Haggerty, Feb 10, 2017
  5. Junio C HamanoFeb 10, 2017
  6. Michael HaggertyFeb 13, 2017
  7. Junio C HamanoFeb 13, 2017
  8. 6/9 refs: push the submodule attribute downMichael Haggerty, Feb 10, 2017
  9. 4/9 register_ref_store(): new functionMichael Haggerty, Feb 10, 2017
  10. 8/9 files_ref_store::submodule: use NULL for the main repositoryMichael Haggerty, Feb 10, 2017
  11. 3/9 refs: remove some unnecessary handling of submodule == ""Michael Haggerty, Feb 10, 2017
  12. 1/9 refs: reorder some function definitionsMichael Haggerty, Feb 10, 2017
  13. Junio C HamanoFeb 10, 2017
  14. 5/9 refs: store submodule ref stores in a hashmapMichael Haggerty, Feb 10, 2017
  15. Jeff KingFeb 10, 2017
  16. Stefan BellerFeb 10, 2017
  17. Junio C HamanoFeb 10, 2017
  18. David TurnerFeb 13, 2017

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.