From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 09/23] fsck: unify object-name code
Date: Thu, 24 Oct 2019 15:05:58 +0900 [thread overview]
Message-ID: <xmqq8spafzjt.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20191018045613.GI17879@sigill.intra.peff.net> (Jeff King's message of "Fri, 18 Oct 2019 00:56:13 -0400")
Jeff King <peff@peff.net> writes:
> +/*
> + * Subsystem for storing human-readable names for each object.
> + *
> + * If fsck_enable_object_names() has not been called, all other functions are
> + * noops.
I think it is clear from the context that put_ and get_ we see below
refer to functions whose true names have fsck_ prefix, but the fact
that this one has fsck_ spelled out disrupts that context.
IOW, s/fsck_// for consistency, perhaps.
> + * Use put_object_name() to seed initial names (e.g. from refnames); the fsck
> + * code will extend that while walking trees, etc.
> + *
> + * Use get_object_name() to get a single name (or NULL if none). Or the more
> + * convenient describe_object(), which always produces an output string with
> + * the oid combined with the name (if any). Note that the return value points
> + * to a rotating array of static buffers, and may be invalidated by a
> + * subsequent call.
> + */
> +void fsck_enable_object_names(struct fsck_options *options);
> +const char *fsck_get_object_name(struct fsck_options *options,
> + struct object *obj);
> +__attribute__((format (printf,3,4)))
> +void fsck_put_object_name(struct fsck_options *options, struct object *obj,
> + const char *fmt, ...);
> +const char *fsck_describe_object(struct fsck_options *options,
> + struct object *obj);
> +
> #endif
> diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
> index 50d28e6fdb..7c7ff7e961 100755
> --- a/t/t1450-fsck.sh
> +++ b/t/t1450-fsck.sh
> @@ -616,7 +616,7 @@ test_expect_success 'fsck --name-objects' '
> remove_object $(git rev-parse julius:caesar.t) &&
> test_must_fail git fsck --name-objects >out &&
> tree=$(git rev-parse --verify julius:) &&
> - test_i18ngrep -E "$tree \((refs/heads/master|HEAD)@\{[0-9]*\}:" out
> + test_i18ngrep "$tree (refs/tags/julius:" out
> )
> '
next prev parent reply other threads:[~2019-10-24 6:06 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-18 4:41 [PATCH 0/23] parsing and fsck cleanups Jeff King
2019-10-18 4:42 ` [PATCH 01/23] parse_commit_buffer(): treat lookup_commit() failure as parse error Jeff King
2019-10-24 3:37 ` Junio C Hamano
2019-10-24 18:01 ` Jeff King
2019-10-18 4:43 ` [PATCH 02/23] parse_commit_buffer(): treat lookup_tree() " Jeff King
2019-10-24 23:12 ` Jonathan Tan
2019-10-24 23:22 ` Jeff King
2019-10-18 4:45 ` [PATCH 03/23] parse_tag_buffer(): treat NULL tag pointer " Jeff King
2019-10-18 4:47 ` [PATCH 04/23] remember commit/tag parse failures Jeff King
2019-10-24 3:51 ` Junio C Hamano
2019-10-24 23:25 ` Jonathan Tan
2019-10-24 23:41 ` Jeff King
2019-10-18 4:48 ` [PATCH 05/23] fsck: stop checking commit->tree value Jeff King
2019-10-24 3:57 ` Junio C Hamano
2019-10-18 4:49 ` [PATCH 06/23] fsck: stop checking commit->parent counts Jeff King
2019-10-18 4:51 ` [PATCH 07/23] fsck: stop checking tag->tagged Jeff King
2019-10-18 4:54 ` [PATCH 08/23] fsck: require an actual buffer for non-blobs Jeff King
2019-10-18 4:56 ` [PATCH 09/23] fsck: unify object-name code Jeff King
2019-10-24 6:05 ` Junio C Hamano [this message]
2019-10-24 18:07 ` Jeff King
2019-10-25 3:23 ` Junio C Hamano
2019-10-25 21:20 ` Jeff King
2019-10-18 4:56 ` [PATCH 10/23] fsck_describe_object(): build on our get_object_name() primitive Jeff King
2019-10-24 6:06 ` Junio C Hamano
2019-10-18 4:57 ` [PATCH 11/23] fsck: use oids rather than objects for object_name API Jeff King
2019-10-18 4:58 ` [PATCH 12/23] fsck: don't require object structs for display functions Jeff King
2019-10-18 4:58 ` [PATCH 13/23] fsck: only provide oid/type in fsck_error callback Jeff King
2019-10-18 4:58 ` [PATCH 14/23] fsck: only require an oid for skiplist functions Jeff King
2019-10-18 4:59 ` [PATCH 15/23] fsck: don't require an object struct for report() Jeff King
2019-10-18 4:59 ` [PATCH 16/23] fsck: accept an oid instead of a "struct blob" for fsck_blob() Jeff King
2019-10-18 4:59 ` [PATCH 17/23] fsck: drop blob struct from fsck_finish() Jeff King
2019-10-18 5:00 ` [PATCH 18/23] fsck: don't require an object struct for fsck_ident() Jeff King
2019-10-18 5:00 ` [PATCH 19/23] fsck: don't require an object struct in verify_headers() Jeff King
2019-10-18 5:00 ` [PATCH 20/23] fsck: rename vague "oid" local variables Jeff King
2019-10-18 5:01 ` [PATCH 21/23] fsck: accept an oid instead of a "struct tag" for fsck_tag() Jeff King
2019-10-18 5:01 ` [PATCH 22/23] fsck: accept an oid instead of a "struct commit" for fsck_commit() Jeff King
2019-10-18 5:02 ` [PATCH 23/23] fsck: accept an oid instead of a "struct tree" for fsck_tree() Jeff King
2019-10-24 23:49 ` [PATCH 0/23] parsing and fsck cleanups Jonathan Tan
2019-10-25 3:11 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq8spafzjt.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).