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

[PATCH 0/6] convert hash_pos() to oid_pos()

From
Jeff King <peff@peff.net>
Date
Jan 28, 2021, 06:12 UTC
Message-ID
<YBJVuckmbGriVa//@coredump.intra.peff.net>

I started this series in early December, after getting annoyed that we still have a function called sha1_pos(). But before I got a chance to polish it, it became hash_pos(). That removed most of my annoyance, though I do still like the type-safety that using object_id brings.

And of course there were some interesting cleanups along the way. So I decided to rebase and send it anyway. I think one could argue that hash_pos() is a better interface because a caller _could_ use it without an object_id. But in practice we do not seem to do so (the one exception is rerere, but I ended up refactoring that away anyway).

So here it is. Possibly code churn, possibly cleanup. Opinions welcome. :)
  [1/6]: commit_graft_pos(): take an oid instead of a bare hash
  [2/6]: rerere: check dirname format while iterating rr_cache directory
  [3/6]: rerere: tighten rr-cache dirname check
  [4/6]: rerere: use strmap to store rerere directories
  [5/6]: hash_pos(): convert to oid_pos()
  [6/6]: oid_pos(): access table through const pointers
 builtin/name-rev.c  | 10 +++---
 commit-graph.c      | 30 +++++++++---------
 commit.c            | 18 +++++------
 commit.h            |  2 +-
 hash-lookup.c       | 18 +++++------
 hash-lookup.h       | 10 +++---
 oid-array.c         |  8 ++---
 pack-bitmap-write.c |  8 ++---
 rerere.c            | 75 ++++++++++++++++++++-------------------------
 shallow.c           |  2 +-
 10 files changed, 87 insertions(+), 94 deletions(-)
-Peff
Next: Jeff King
Message 1 of 15 in “convert hash_pos() to oid_pos()”
  1. 0/6 convert hash_pos() to oid_pos()Jeff King, Jan 28, 2021
  2. 1/6 commit_graft_pos(): take an oid instead of a bare hashJeff King, Jan 28, 2021
  3. Derrick StoleeJan 28, 2021
  4. 2/6 rerere: check dirname format while iterating rr_cache directoryJeff King, Jan 28, 2021
  5. 3/6 rerere: tighten rr-cache dirname checkJeff King, Jan 28, 2021
  6. Taylor BlauJan 28, 2021
  7. Jeff KingJan 28, 2021
  8. Jeff KingJan 28, 2021
  9. Junio C HamanoJan 28, 2021
  10. Junio C HamanoJan 28, 2021
  11. Jeff KingJan 28, 2021
  12. 5/6 hash_pos(): convert to oid_pos()Jeff King, Jan 28, 2021
  13. Taylor BlauJan 28, 2021
  14. Jeff KingJan 29, 2021
  15. 6/6 oid_pos(): access table through const pointersJeff King, Jan 28, 2021

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.