From: Patrick Steinhardt <ps@pks.im>
To: karthik nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 08/10] reftable/dump: drop unused printing functionality
Date: Wed, 14 Aug 2024 14:56:57 +0200 [thread overview]
Message-ID: <ZrypmQOthfGS1JFn@tanuki> (raw)
In-Reply-To: <CAOLa=ZScKRvAWsa4D+_BCyAbxQ9580RBnJ+==DfCvrGV6C2ETg@mail.gmail.com>
On Tue, Aug 13, 2024 at 06:14:33AM -0400, karthik nayak wrote:
> Patrick Steinhardt <ps@pks.im> writes:
>
> > We have a bunch of infrastructure wired up that allows us to print
> > reftable records, tables and stacks. While this functionality is wired
> > up via various "test-tool reftable" options, it is never used. It also
> > feels kind of dubious whether any other eventual user of the reftable
> > library should use it as it very much feels like a debugging aid rather
> > than something sensible. The format itself is somewhat inscrutable and
> > the infrastructure is non-extensible.
> >
> > Drop this code. The only remaining function in this context is
> > `reftable_reader_print_blocks()`, which we do use in our tests.
> >
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> > reftable/dump.c | 16 +----
> > reftable/generic.c | 47 -------------
> > reftable/reader.c | 21 ------
> > reftable/record.c | 127 ------------------------------------
> > reftable/record.h | 4 --
> > reftable/reftable-generic.h | 3 -
> > reftable/reftable-reader.h | 2 -
> > reftable/reftable-record.h | 8 ---
> > reftable/reftable-stack.h | 3 -
> > reftable/stack.c | 20 ------
> > reftable/stack_test.c | 7 --
> > 11 files changed, 1 insertion(+), 257 deletions(-)
> >
> > diff --git a/reftable/dump.c b/reftable/dump.c
> > index 2953e0a83a..35a1731da9 100644
> > --- a/reftable/dump.c
> > +++ b/reftable/dump.c
> > @@ -41,9 +41,6 @@ int reftable_dump_main(int argc, char *const *argv)
> > {
> > int err = 0;
> > int opt_dump_blocks = 0;
> > - int opt_dump_table = 0;
> > - int opt_dump_stack = 0;
> > - uint32_t opt_hash_id = GIT_SHA1_FORMAT_ID;
> > const char *arg = NULL, *argv0 = argv[0];
> >
> > for (; argc > 1; argv++, argc--)
> > @@ -51,12 +48,6 @@ int reftable_dump_main(int argc, char *const *argv)
> > break;
> > else if (!strcmp("-b", argv[1]))
> > opt_dump_blocks = 1;
> > - else if (!strcmp("-t", argv[1]))
> > - opt_dump_table = 1;
> > - else if (!strcmp("-6", argv[1]))
> > - opt_hash_id = GIT_SHA256_FORMAT_ID;
> > - else if (!strcmp("-s", argv[1]))
> > - opt_dump_stack = 1;
> > else if (!strcmp("-?", argv[1]) || !strcmp("-h", argv[1])) {
> > print_help();
> > return 2;
> > @@ -70,13 +61,8 @@ int reftable_dump_main(int argc, char *const *argv)
>
> I'm a bit skeptical about this change because I definitely have used the
> `-t` and `-s` options a bunch of times to understand what a table holds.
> Since the reftable format is binary, this is the only tooling we have
> which allows us to read this format from a plumbing point of view. I'd
> keep them. I guess the stack printing just iterates over the tables and
> prints them and could be removed, but I'd keep the option to dump a
> table.
Well, I have to say that I find the output to be rather useless. But
you're making a valid point: we don't have anything else to peek at the
table's contents.
I'll keep this in v2, but make it an internal implementation detail of
the test-tool. It certainly has no place in the reftable library in my
opinion.
> Also this patch misses cleaning up `print_help` if we go down this
> route.
Indeed, will fix.
Patrick
next prev parent reply other threads:[~2024-08-14 12:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 6:24 [PATCH 00/10] reftable: drop generic `reftable_table` interface Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 01/10] reftable/merged: expose functions to initialize iterators Patrick Steinhardt
2024-08-13 9:36 ` karthik nayak
2024-08-14 12:56 ` Patrick Steinhardt
2024-08-19 16:55 ` Justin Tobler
2024-08-20 12:00 ` Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 02/10] reftable/merged: rename `reftable_new_merged_table()` Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 03/10] reftable/merged: stop using generic tables in the merged table Patrick Steinhardt
2024-08-13 9:58 ` karthik nayak
2024-08-19 16:47 ` Justin Tobler
2024-08-13 6:24 ` [PATCH 04/10] reftable/stack: open-code reading refs Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 05/10] reftable/iter: drop double-checking logic Patrick Steinhardt
2024-08-13 6:57 ` Eric Sunshine
2024-08-13 6:24 ` [PATCH 06/10] reftable/generic: move generic iterator code into iterator interface Patrick Steinhardt
2024-08-13 10:04 ` karthik nayak
2024-08-14 12:56 ` Patrick Steinhardt
2024-08-14 16:24 ` Junio C Hamano
2024-08-15 11:04 ` karthik nayak
2024-08-13 6:24 ` [PATCH 07/10] reftable/dump: drop unused `compact_stack()` Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 08/10] reftable/dump: drop unused printing functionality Patrick Steinhardt
2024-08-13 10:14 ` karthik nayak
2024-08-14 12:56 ` Patrick Steinhardt [this message]
2024-08-13 6:24 ` [PATCH 09/10] reftable/dump: move code into "t/helper/test-reftable.c" Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 10/10] reftable/generic: drop interface Patrick Steinhardt
2024-08-13 10:17 ` [PATCH 00/10] reftable: drop generic `reftable_table` interface karthik nayak
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=ZrypmQOthfGS1JFn@tanuki \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.