Message ID | ZoVYjrfCFO0_K4Ry@ArchLinux (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | ref consistency check infra setup | expand |
On 24/07/03 09:56PM, shejialuo wrote: > 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". I think the commit message could be expanded on to provide additional context and reasoning for the change. From reading this alone, it sounds like we have already introduced the ref consistency check and are now looking to rename a variable. When really this is a preparatory change. Without reading ahead, I'm also left wondering why this name change reduces ambiguity. -Justin
On Fri, Jul 05, 2024 at 05:07:29PM -0500, Justin Tobler wrote: > On 24/07/03 09:56PM, shejialuo wrote: > > 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". > > I think the commit message could be expanded on to provide additional > context and reasoning for the change. From reading this alone, it sounds > like we have already introduced the ref consistency check and are now > looking to rename a variable. When really this is a preparatory change. > Without reading ahead, I'm also left wondering why this name change > reduces ambiguity. > Yes, I will add more information to show the context. "skiplist" is initialized using "git_fsck_config" to parse the user-specific config. In this series, we introduce ref-specific check. "skiplist" is a general name which may make the caller think "skiplist" is related to both the refs and objects. For later implementation, we may also introduce "skiplist" for refs, but for refs, we concern about the name not the "oidset". I will add more information to explain how this change reduces ambiguity. Thanks, Jialuo
diff --git a/fsck.c b/fsck.c index eea7145470..1960bfeba9 100644 --- a/fsck.c +++ b/fsck.c @@ -205,7 +205,7 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values) if (!strcmp(buf, "skiplist")) { if (equal == len) die("skiplist requires a path"); - oidset_parse_file(&options->skiplist, buf + equal + 1, + oidset_parse_file(&options->oid_skiplist, buf + equal + 1, the_repository->hash_algo); buf += len + 1; continue; @@ -223,7 +223,7 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values) static int object_on_skiplist(struct fsck_options *opts, const struct object_id *oid) { - return opts && oid && oidset_contains(&opts->skiplist, oid); + return opts && oid && oidset_contains(&opts->oid_skiplist, oid); } __attribute__((format (printf, 5, 6))) diff --git a/fsck.h b/fsck.h index 6085a384f6..1ee3dd85ba 100644 --- a/fsck.h +++ b/fsck.h @@ -136,7 +136,7 @@ struct fsck_options { fsck_error error_func; unsigned strict:1; enum fsck_msg_type *msg_type; - struct oidset skiplist; + struct oidset oid_skiplist; struct oidset gitmodules_found; struct oidset gitmodules_done; struct oidset gitattributes_found;
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". Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: shejialuo <shejialuo@gmail.com> --- fsck.c | 4 ++-- fsck.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)