Skip to content

jk/loose-object-cache sha1/object_id fixups

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11sha1-file: fix outdated sha1 comment referencessha1-file.c+3 -30 replies
2/11update comment references to sha1_object_info()builtin/cat-file.c builtin/pack-objects.c cache.h+6 -60 replies
3/11http: use struct object_id instead of bare sha1http-push.c http-walker.c http.c +1 more+14 -140 replies
4/11sha1-file: modernize loose object file functionshttp-walker.c http.c object-store.h +2 more+51 -480 replies
5/11sha1-file: modernize loose header/stream functionscache.h sha1-file.c streaming.c+51 -490 replies
6/11sha1-file: convert pass-through functions to object_idsha1-file.c+7 -130 replies
7/11convert has_sha1_file() callers to has_object_file()apply.c builtin/fetch.c builtin/index-pack.c +9 more+47 -160 replies
8/11sha1-file: drop has_sha1_file()contrib/coccinelle/object_id.cocci object-store.h sha1-file.c+6 -540 replies
9/11sha1-file: prefer "loose object file" to "sha1 file" in messagessha1-file.c+3 -30 replies
10/11sha1-file: avoid "sha1 file" for generic use in messagessha1-file.c+2 -20 replies
11/11prefer "hash mismatch" to "sha1 mismatch"Documentation/git-fsck.txt object.c sha1-file.c +1 more+8 -80 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/11] jk/loose-object-cache sha1/object_id fixups
Quoted 21 lines · René Scharfe

Am 28.12.2018 um 19:04 schrieb Junio C Hamano:

Quoted 13 lines

* jk/loose-object-cache (2018-11-24) 10 commits (merged to 'next' on 2018-12-28 at 5a5faf384e)
+ odb_load_loose_cache: fix strbuf leak
+ fetch-pack: drop custom loose object cache
+ sha1-file: use loose object cache for quick existence check
+ object-store: provide helpers for loose_objects_cache
+ sha1-file: use an object_directory for the main object dir
+ handle alternates paths the same as the main object dir
+ sha1_file_name(): overwrite buffer instead of appending
+ rename "alternate_object_database" to "object_directory"
+ submodule--helper: prefer strip_suffix() to ends_with()
+ fsck: do not reuse child_process structs

Quoted 6 lines

Originally merged to 'next' on 2018-11-24

Code clean-up with optimization for the codepath that checks (non-)existence of loose objects.

Will merge to 'master'.

Quoted 7 lines

So this has hit master in the meantime. We discussed a sort performance fix in [1]; I'll reply with a short series containing a cleaned-up and rebased version as a follow-up.

object-store: factor out odb_loose_cache()
object-store: factor out odb_clear_loose_cache()
object-store: use one oid_array per subdirectory for loose cache

Thanks! With the exception of one tiny nit, this looks good to me.

I also cleaned up my sha1/object_id patch and rebased it on top of what you have here. Though as I worked on it, it expanded in scope a bit. Possibly it should be a separate series entirely, but that would create some annoying textual conflicts on merge.

[01/11]: sha1-file: fix outdated sha1 comment references [02/11]: update comment references to sha1_object_info() [03/11]: http: use struct object_id instead of bare sha1 [04/11]: sha1-file: modernize loose object file functions [05/11]: sha1-file: modernize loose header/stream functions [06/11]: sha1-file: convert pass-through functions to object_id [07/11]: convert has_sha1_file() callers to has_object_file() [08/11]: sha1-file: drop has_sha1_file()
[09/11]: sha1-file: prefer "loose object file" to "sha1 file" in messages [10/11]: sha1-file: avoid "sha1 file" for generic use in messages [11/11]: prefer "hash mismatch" to "sha1 mismatch"

 Documentation/git-fsck.txt |   6 +-
 apply.c                    |   2 +-
 builtin/cat-file.c         |   6 +-
 builtin/fetch.c            |   7 +-
 builtin/index-pack.c       |   2 +-
 builtin/pack-objects.c     |   4 +-
 builtin/reflog.c           |   2 +-
 builtin/show-ref.c         |   2 +-
 bulk-checkin.c             |   2 +-
 cache-tree.c               |   4 +-
 cache.h                    |   6 +-
 http-push.c                |   2 +-
 http-walker.c              |  10 +-
 http.c                     |  14 +--
 http.h                     |   6 +-
 object-store.h             |  20 ++--
 object.c                   |   4 +-
 refs.c                     |   2 +-
 send-pack.c                |   2 +-
 sha1-file.c                | 219 +++++++++++++++++--------------------
 streaming.c                |  16 +--
 t/t1450-fsck.sh            |   2 +-
 22 files changed, 161 insertions(+), 179 deletions(-)

-Peff