Improvements to sha1_file
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest8 patches 4 repliesIn review
- v48 patches 16 repliesSuperseded
- v34 patches 0 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 4 patches | 8 replies | Superseded | |
| v1 RFC | 4 patches | 4 replies | Superseded |
Changes in v5 from the cover letter
- patch 2
- Updated commit message to explain why OBJECT_INFO_ALLOW_UNKNOWN_TYPE is defined to be 2, not 1.
- patch 3
- Made all invocations of sha1_object_info_extended() compare "< 0".
- patch 5
- Made all invocations of sha1_object_info_extended() compare "< 0".
- patch 7
- Rewrote patch to make sha1_object_info_extended() accept NULL struct object_info pointer.
- patch 8
- Made has_sha1_file_with_flags send NULL instead of blank struct object_info.
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | sha1_file: teach packed_object_info about typenamesha1_file.c | +12 | 0 replies | |
| 2/8 | sha1_file: rename LOOKUP_UNKNOWN_OBJECTbuiltin/ cache.h sha1_file.c | +5 | 0 replies | |
| 3/8 | sha1_file: rename LOOKUP_REPLACE_OBJECTbuiltin/ cache.h sha1_file.c | +18 | 0 replies | |
| 4/8 | sha1_file: move delta base cache code upsha1_file.c | +110 | 0 replies | |
| 5/8 | sha1_file: refactor read_objectcache.h sha1_file.c | +43 | 0 replies | |
| 6/8 | sha1_file: improve sha1_object_info_extendedcache.h sha1_file.c | +28 | 0 replies | |
| 7/8 | sha1_file: do not access pack if unneededsha1_file.c | +11 | 0 replies | |
| 8/8 | sha1_file: refactor has_sha1_file_with_flagsbuiltin/ builtin/ cache.h +1 more | +13 | 8 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCH v5 0/8] Improvements to sha1_file
Thanks, Junio. A reply to your comment on patch 7:
Quoted 8 lines
... this "if" statement feels like a maintenance nightmare. The intent of the guard, I think, is "when the call wants absolutely nothing but whence", but the implementation of the guard will not stay true to the intent whenever somebody adds a new field to oi.
I wonder if it makes more sense to have a new field "
whence_only", which is set only by such a specialized caller, which this guard checks (and no other fields).
After some more thought, I think I came up with a better solution - allow sha1_object_info_extended() to take a NULL struct object_info pointer, and immediately assign it (if NULL) a blank struct, but use the NULL-ness as an indication that we can skip accessing the packfile. The last patch actually doesn't even need the "whence", so we can do this.
Changes from v4:
- patch 2
- Updated commit message to explain why OBJECT_INFO_ALLOW_UNKNOWN_TYPE is defined to be 2, not 1.
- patch 3
- Made all invocations of sha1_object_info_extended() compare "< 0".
- patch 5
- Made all invocations of sha1_object_info_extended() compare "< 0".
- patch 7
- Rewrote patch to make sha1_object_info_extended() accept NULL struct object_info pointer.
- patch 8
- Made has_sha1_file_with_flags send NULL instead of blank struct object_info.
Jonathan Tan (8):
sha1_file: teach packed_object_info about typename
sha1_file: rename LOOKUP_UNKNOWN_OBJECT
sha1_file: rename LOOKUP_REPLACE_OBJECT
sha1_file: move delta base cache code up
sha1_file: refactor read_object
sha1_file: improve sha1_object_info_extended
sha1_file: do not access pack if unneeded
sha1_file: refactor has_sha1_file_with_flags
builtin/cat-file.c | 7 +- builtin/fetch.c | 10 +- builtin/index-pack.c | 3 +- cache.h | 36 +++-- sha1_file.c | 385 ++++++++++++++++++++++++++------------------------- 5 files changed, 224 insertions(+), 217 deletions(-)
Signature · 1 line
2.13.1.611.g7e3b11ae1-goog