Hi All: This version enhances the patch 1 and patch 2 commit messages according to the review of Justin. Thanks, Jialuo shejialuo (9): fsck: rename "skiplist" to "oid_skiplist" fsck: add a unified interface for reporting fsck messages fsck: add refs-related options and error report function refs: set up ref consistency check infrastructure builtin/refs: add verify subcommand builtin/fsck: add `git-refs verify` child process files-backend: add unified interface for refs scanning fsck: add ref name check for files backend fsck: add ref content check for files backend Documentation/fsck-msgids.txt | 12 ++ Documentation/git-refs.txt | 13 ++ builtin/fsck.c | 32 ++++- builtin/mktag.c | 1 + builtin/refs.c | 44 ++++++ fsck.c | 107 +++++++++++--- fsck.h | 63 ++++++--- object-file.c | 11 +- refs.c | 7 +- refs.h | 8 ++ refs/debug.c | 11 ++ refs/files-backend.c | 255 +++++++++++++++++++++++++++++++++- refs/packed-backend.c | 8 ++ refs/refs-internal.h | 11 +- refs/reftable-backend.c | 8 ++ t/t0602-reffiles-fsck.sh | 211 ++++++++++++++++++++++++++++ 16 files changed, 745 insertions(+), 57 deletions(-) create mode 100755 t/t0602-reffiles-fsck.sh Range-diff against v7: 1: f5fcf36132 ! 1: 61e475840f fsck: rename "skiplist" to "oid_skiplist" @@ Metadata ## Commit message ## fsck: rename "skiplist" to "oid_skiplist" - Because we introduce ref consistency check. The original "skiplist" is a - common option which is set up during handling user configs. To avoid - causing ambiguity, rename "skiplist" to "oid_skiplist". + The "skiplist" field in "fsck_options" is related to objects. Because we + are going to introduce ref consistency check, the "skiplist" name is too + general which will make the caller think "skiplist" is related to both + the refs and objects. + + It may seem that for both refs and objects, we should provide a general + "skiplist" here. However, the type for "skiplist" is `struct oidset` + which is totally unsuitable for refs. + + To avoid above ambiguity, rename "skiplist" to "oid_skiplist". Mentored-by: Patrick Steinhardt <ps@xxxxxx> Mentored-by: Karthik Nayak <karthik.188@xxxxxxxxx> 2: c81b5b6fba ! 2: f2576d88a9 fsck: add a unified interface for reporting fsck messages @@ Metadata ## Commit message ## fsck: add a unified interface for reporting fsck messages - The static function "report" provided by "fsck.c" aims at reporting the - problems related to object database which cannot be reused for refs. - In order to provide a unified interface which can report either objects - or refs, create a new function "vfsck_report" by adding - "checked_ref_name" parameter following the "report" prototype. However, - instead of using "...", provide "va_list" to allow more flexibility. + The static function "report" provided by "fsck.c" aims at checking fsck + error type and calling the callback "error_func" to report the message. + However, "report" function is only related to object database which + cannot be reused for refs. In order to provide a unified interface which + can report either objects or refs, create a new function "vfsck_report" + by adding "checked_ref_name" parameter following the "report" prototype. + Instead of using "...", provide "va_list" to allow more flexibility. - The "vfsck_report" function will use "error_func" registered in - "fsck_options" function to report customized messages. Change - "error_func" prototype to align with the "vfsck_report". + Like "report", the "vfsck_report" function will use "error_func" + registered in "fsck_options" to report customized messages. Change + "error_func" prototype to align with the new "vfsck_report". - Change "report" function to make it use "vfsck_report" to report - objects-related messages. Add a new function called "fsck_refs_report" - to use "vfsck_report" to report refs-related messages. + Then, change "report" function to use "vfsck_report" to report objects + related messages. Add a new function called "fsck_refs_report" to use + "vfsck_report" to report refs related messages. Mentored-by: Patrick Steinhardt <ps@xxxxxx> Mentored-by: Karthik Nayak <karthik.188@xxxxxxxxx> 3: 53156dc847 = 3: c3c2dda50c fsck: add refs-related options and error report function 4: 358f4a1be9 = 4: e826dc17ec refs: set up ref consistency check infrastructure 5: e632859df6 = 5: 33cac4882b builtin/refs: add verify subcommand 6: 5d7a6261ae = 6: 32668e3543 builtin/fsck: add `git-refs verify` child process 7: 33311af1b1 = 7: df83b2a990 files-backend: add unified interface for refs scanning 8: 02bd3ac952 = 8: c696c15651 fsck: add ref name check for files backend 9: 94d123471d = 9: 8b0f3aeb9c fsck: add ref content check for files backend -- 2.45.2