From: Patrick Steinhardt <ps@pks.im>
To: karthik nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 10/15] t/helper: inline `reftable_stack_print_directory()`
Date: Tue, 20 Aug 2024 10:06:22 +0200 [thread overview]
Message-ID: <ZsROcj6FDHyQjc-U@tanuki> (raw)
In-Reply-To: <CAOLa=ZSOiNKdJcMkE-P052cZjRXPcFQ7y1LnZFOZ0DMtqGnM+g@mail.gmail.com>
On Tue, Aug 20, 2024 at 09:34:21AM +0200, karthik nayak wrote:
> Patrick Steinhardt <ps@pks.im> writes:
>
> > Move `reftable_stack_print_directory()` into the "dump-reftable" helper.
> > This follows the same reasoning as the preceding commit.
> >
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> > reftable/reftable-stack.h | 3 ---
> > reftable/stack.c | 20 --------------------
> > reftable/stack_test.c | 7 -------
> > t/helper/test-reftable.c | 23 ++++++++++++++++++++++-
> > 4 files changed, 22 insertions(+), 31 deletions(-)
> >
> > diff --git a/reftable/reftable-stack.h b/reftable/reftable-stack.h
> > index 09e97c9991..f4f8cabc7f 100644
> > --- a/reftable/reftable-stack.h
> > +++ b/reftable/reftable-stack.h
> > @@ -140,7 +140,4 @@ struct reftable_compaction_stats {
> > struct reftable_compaction_stats *
> > reftable_stack_compaction_stats(struct reftable_stack *st);
> >
> > -/* print the entire stack represented by the directory */
> > -int reftable_stack_print_directory(const char *stackdir, uint32_t hash_id);
> > -
> > #endif
> > diff --git a/reftable/stack.c b/reftable/stack.c
> > index d08ec00959..bedd503e7e 100644
> > --- a/reftable/stack.c
> > +++ b/reftable/stack.c
> > @@ -1603,23 +1603,3 @@ int reftable_stack_clean(struct reftable_stack *st)
> > reftable_addition_destroy(add);
> > return err;
> > }
> > -
> > -int reftable_stack_print_directory(const char *stackdir, uint32_t hash_id)
> > -{
> > - struct reftable_stack *stack = NULL;
> > - struct reftable_write_options opts = { .hash_id = hash_id };
> > - struct reftable_merged_table *merged = NULL;
> > - struct reftable_table table = { NULL };
> > -
> > - int err = reftable_new_stack(&stack, stackdir, &opts);
> > - if (err < 0)
> > - goto done;
> > -
> > - merged = reftable_stack_merged_table(stack);
> > - reftable_table_from_merged_table(&table, merged);
> > - err = reftable_table_print(&table);
> > -done:
> > - if (stack)
> > - reftable_stack_destroy(stack);
> > - return err;
> > -}
> > diff --git a/reftable/stack_test.c b/reftable/stack_test.c
> > index dbca9eaf4a..42044ed8a3 100644
> > --- a/reftable/stack_test.c
> > +++ b/reftable/stack_test.c
> > @@ -179,13 +179,6 @@ static void test_reftable_stack_add_one(void)
> > EXPECT(0 == strcmp("master", dest.value.symref));
> > EXPECT(st->readers_len > 0);
> >
> > - printf("testing print functionality:\n");
> > - err = reftable_stack_print_directory(dir, GIT_SHA1_FORMAT_ID);
> > - EXPECT_ERR(err);
> > -
> > - err = reftable_stack_print_directory(dir, GIT_SHA256_FORMAT_ID);
> > - EXPECT(err == REFTABLE_FORMAT_ERROR);
> > -
> >
>
> We loose this test due to the movement. It is okay, because the code
> that it is testing, is now only available in the testing section and is
> a test-helper. But it would be nice to mention this in the commit
> message.
Ah, good point, I'll mention that. The test was basically worthless
anyway as we didn't very anything -- only that it doesn't crash.
Patrick
next prev parent reply other threads:[~2024-08-20 8:06 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 13:22 [PATCH v2 00/15] reftable: drop generic `reftable_table` interface Patrick Steinhardt
2024-08-14 13:22 ` [PATCH v2 01/15] reftable/merged: expose functions to initialize iterators Patrick Steinhardt
2024-08-14 13:22 ` [PATCH v2 02/15] reftable/merged: rename `reftable_new_merged_table()` Patrick Steinhardt
2024-08-14 13:22 ` [PATCH v2 03/15] reftable/merged: stop using generic tables in the merged table Patrick Steinhardt
2024-08-14 13:22 ` [PATCH v2 04/15] reftable/stack: open-code reading refs Patrick Steinhardt
2024-08-14 13:22 ` [PATCH v2 05/15] reftable/iter: drop double-checking logic Patrick Steinhardt
2024-08-14 13:23 ` [PATCH v2 06/15] reftable/generic: move generic iterator code into iterator interface Patrick Steinhardt
2024-08-14 13:23 ` [PATCH v2 07/15] reftable/dump: drop unused `compact_stack()` Patrick Steinhardt
2024-08-14 13:23 ` [PATCH v2 08/15] t/helper: inline `reftable_dump_main()` Patrick Steinhardt
2024-08-14 13:23 ` [PATCH v2 09/15] t/helper: inline `reftable_reader_print_file()` Patrick Steinhardt
2024-08-14 13:23 ` [PATCH v2 10/15] t/helper: inline `reftable_stack_print_directory()` Patrick Steinhardt
2024-08-20 7:34 ` karthik nayak
2024-08-20 8:06 ` Patrick Steinhardt [this message]
2024-08-14 13:23 ` [PATCH v2 11/15] t/helper: inline `reftable_table_print()` Patrick Steinhardt
2024-08-14 13:23 ` [PATCH v2 12/15] t/helper: inline printing of reftable records Patrick Steinhardt
2024-08-14 13:23 ` [PATCH v2 13/15] t/helper: use `hash_to_hex_algop()` to print hashes Patrick Steinhardt
2024-08-14 13:23 ` [PATCH v2 14/15] t/helper: refactor to not use `struct reftable_table` Patrick Steinhardt
2024-08-14 13:23 ` [PATCH v2 15/15] reftable/generic: drop interface Patrick Steinhardt
2024-08-14 13:31 ` [PATCH v2 00/15] reftable: drop generic `reftable_table` interface Patrick Steinhardt
2024-08-14 17:21 ` Junio C Hamano
2024-08-15 5:29 ` Patrick Steinhardt
2024-08-20 7:38 ` karthik nayak
2024-08-22 6:34 ` [PATCH v3 " Patrick Steinhardt
2024-08-22 6:34 ` [PATCH v3 01/15] reftable/merged: expose functions to initialize iterators Patrick Steinhardt
2024-08-22 6:34 ` [PATCH v3 02/15] reftable/merged: rename `reftable_new_merged_table()` Patrick Steinhardt
2024-08-22 6:34 ` [PATCH v3 03/15] reftable/merged: stop using generic tables in the merged table Patrick Steinhardt
2024-08-22 6:34 ` [PATCH v3 04/15] reftable/stack: open-code reading refs Patrick Steinhardt
2024-08-22 6:34 ` [PATCH v3 05/15] reftable/iter: drop double-checking logic Patrick Steinhardt
2024-08-22 6:34 ` [PATCH v3 06/15] reftable/generic: move generic iterator code into iterator interface Patrick Steinhardt
2024-08-22 6:35 ` [PATCH v3 07/15] reftable/dump: drop unused `compact_stack()` Patrick Steinhardt
2024-08-22 6:35 ` [PATCH v3 08/15] t/helper: inline `reftable_dump_main()` Patrick Steinhardt
2024-08-22 6:35 ` [PATCH v3 09/15] t/helper: inline `reftable_reader_print_file()` Patrick Steinhardt
2024-08-22 6:35 ` [PATCH v3 10/15] t/helper: inline `reftable_stack_print_directory()` Patrick Steinhardt
2024-08-22 6:35 ` [PATCH v3 11/15] t/helper: inline `reftable_table_print()` Patrick Steinhardt
2024-08-22 6:35 ` [PATCH v3 12/15] t/helper: inline printing of reftable records Patrick Steinhardt
2024-08-22 6:35 ` [PATCH v3 13/15] t/helper: use `hash_to_hex_algop()` to print hashes Patrick Steinhardt
2024-08-22 6:35 ` [PATCH v3 14/15] t/helper: refactor to not use `struct reftable_table` Patrick Steinhardt
2024-08-22 6:35 ` [PATCH v3 15/15] reftable/generic: drop interface Patrick Steinhardt
2024-08-22 8:03 ` [PATCH v3 00/15] reftable: drop generic `reftable_table` interface karthik nayak
2024-08-22 17: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=ZsROcj6FDHyQjc-U@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 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).