Re: [PATCH v2 05/10] fsck.c: rename remaining fsck_msg_id "id" to "msg_id"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 18, 2021, 22:23 UTC
- Message-ID
- <xmqq35xtdnhf.fsf@gitster.g>
- In-Reply-To
- <20210218105840.11989-6-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 6 quoted lines
> Rename the remaining variables of type fsck_msg_id from "id" to > "msg_id". This change is relatively small, and is worth the churn for > a later change where we have different id's in the "report" function. > --- > fsck.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-)
Up to this point I have no objections to the patches themselves, but this one is not signed off.
Show 52 quoted lines
> diff --git a/fsck.c b/fsck.c
> index 1070071ffec..dbb6f7c4ee2 100644
> --- a/fsck.c
> +++ b/fsck.c
> @@ -264,19 +264,19 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values)
> free(to_free);
> }
>
> -static void append_msg_id(struct strbuf *sb, enum fsck_msg_id id)
> +static void append_msg_id(struct strbuf *sb, enum fsck_msg_id msg_id)
> {
> - const char *msg_id = msg_id_info[id].id_string;
> + const char *msg_id_str = msg_id_info[msg_id].id_string;
> for (;;) {
> - char c = *(msg_id)++;
> + char c = *(msg_id_str)++;
>
> if (!c)
> break;
> if (c != '_')
> strbuf_addch(sb, tolower(c));
> else {
> - assert(*msg_id);
> - strbuf_addch(sb, *(msg_id)++);
> + assert(*msg_id_str);
> + strbuf_addch(sb, *(msg_id_str)++);
> }
> }
>
> @@ -292,11 +292,11 @@ static int object_on_skiplist(struct fsck_options *opts,
> __attribute__((format (printf, 5, 6)))
> static int report(struct fsck_options *options,
> const struct object_id *oid, enum object_type object_type,
> - enum fsck_msg_id id, const char *fmt, ...)
> + enum fsck_msg_id msg_id, const char *fmt, ...)
> {
> va_list ap;
> struct strbuf sb = STRBUF_INIT;
> - int msg_type = fsck_msg_type(id, options), result;
> + int msg_type = fsck_msg_type(msg_id, options), result;
>
> if (msg_type == FSCK_IGNORE)
> return 0;
> @@ -309,7 +309,7 @@ static int report(struct fsck_options *options,
> else if (msg_type == FSCK_INFO)
> msg_type = FSCK_WARN;
>
> - append_msg_id(&sb, id);
> + append_msg_id(&sb, msg_id);
>
> va_start(ap, fmt);
> strbuf_vaddf(&sb, fmt, ap);