Skip to content

convert hash_pos() to oid_pos()

Jeff King git 1 version In review

Get series with b4
b4 am YBJVuckmbGriVa//@coredump.intra.peff.net

Versions newest first

  1. v1 Latest5 of 6 patches 9 repliesIn review

5 of 6 patches are in this archive. The cover letter announces 6.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6commit_graft_pos(): take an oid instead of a bare hashcommit.c commit.h shallow.c+6 -61 reply
2/6rerere: check dirname format while iterating rr_cache directoryrerere.c+11 -30 replies
3/6rerere: tighten rr-cache dirname checkrerere.c+3 -21 reply
5/6hash_pos(): convert to oid_pos()builtin/name-rev.c commit-graph.c commit.c +4 more+43 -432 replies
6/6oid_pos(): access table through const pointersbuiltin/name-rev.c commit-graph.c commit.c +4 more+13 -130 replies

Reviews trailers per patch

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

Read the v1 thread

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

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