git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Christian Couder <christian.couder@gmail.com>
Cc: Chandra Pratap <chandrapratap3519@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [GSoC][PATCH v5 0/7] t: port reftable/pq_test.c to the unit testing framework
Date: Wed, 24 Jul 2024 10:56:37 +0200	[thread overview]
Message-ID: <ZqDBxUC34pV2TLGz@tanuki> (raw)
In-Reply-To: <CAP8UFD12Cqorr7oPS+JfOTYY6LaNUgPEJaEscf-jwLUOur+xqA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3511 bytes --]

On Wed, Jul 24, 2024 at 09:17:55AM +0200, Christian Couder wrote:
> On Wed, Jul 24, 2024 at 7:12 AM Chandra Pratap
> <chandrapratap3519@gmail.com> wrote:
> > On Tue, 23 Jul 2024 at 22:39, Junio C Hamano <gitster@pobox.com> wrote:
> > I did talk about this with Patrick and Christian on a private slack channel
> > a few weeks ago and here is how that conversation went:
> >
> > Me: Hey, I wanted to talk about the message from Junio the other day.
> > It is true that through this project, we are modifying the reftable directory
> > to a point that it is no longer easily usable by someone from outside. If
> > that is the direction we want to take, wouldn't it make more sense to get
> > rid of reftable/pq.{c, h} altogether and use Git's prio-queue instead?
> >
> > Christian: Yeah, I think the direction the Git project wants to take is to
> > integrate the reftable code more and more with the Git code. On the other
> > hand, there are libification projects which are trying to split parts of the
> > Git code into libraries usable by other projects. But I don't think each of
> > these libraries should have their own test framework, their own prio-queue
> > implementation, their own string implementation, etc. So, even if I am not
> > sure about the end result, I think it would be ok to modify the reftable code
> > so that it uses the Git's prio queue and maybe other Git data structures.
> > But I'd like Patrick to confirm, and the list to agree to this. So I'd
> > rather wait
> > until Patrick is back from his vacation before doing things like replacing
> > reftable/pq.{c, h} with Git's prio-queue.
> 
> Yeah, if it had been discussed and agreed on earlier, I think
> replacing the pq implementation would have made sense. Now I think
> it's a bit late at this stage in Chandra's GSoC to go in this
> direction though. I think it's better if he can focus on finishing to
> replace the unit test framework.

Replacing the priority queue with the one we already have will create
additional work in the future when we want to get the reftable library
back into a state where it can be used as a standalone library again. I
know that it's currently a mess anyway, but I've heard from multiple
folks already who are interested in using the reftable library in their
own C projects (most importantly libgit2).

If we want Git to be the reftable upstream for such projects, then we
should play nice and not make their lifes harder. I plan to work on
portability work as soon as somebody properly commits to integrating
reftables into their project. This will probably come in the form of:

  - Removing all Git-specific includes in the "reftable/" directory.

  - Declaring a list of "shim" functions and types that users of the
    reftable library need to use.

  - Implementing those shim functions for Git.

Of course, those shims will closely follow the interfaces that we have
in Git. E.g. there will shims for "strbuf", the tempfile interface, and
everything else that we currently use in the reftable library. So
ultimately, I expect that the shim implementations will simply look like
the following:

```
typedef struct strbuf reftable_buf;

static inline void reftable_buf_add(struct strbuf reftable_buf *buf,
                                    const void *data, size_t len)
{
    strbuf_add(buf, data, len);
}
```

While we could also shim out the priority queue, I don't really think
that it is worth it.

Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2024-07-24  8:56 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06  7:40 [GSoC][PATCH 0/6] t: port reftable/pq_test.c to the unit testing Chandra Pratap
2024-06-06  7:40 ` [GSoC][PATCH 1/6] reftable: clean up reftable/pq.c Chandra Pratap
2024-06-06  8:51   ` Christian Couder
2024-06-06 10:07     ` Chandra Pratap
2024-06-06 16:23       ` Christian Couder
2024-06-06  7:40 ` [GSoC][PATCH 2/6] t: move reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-06-06 11:48   ` Patrick Steinhardt
2024-06-06  7:40 ` [GSoC][PATCH 3/6] t-reftable-pq: make merged_iter_pqueue_check() static Chandra Pratap
2024-06-06  7:40 ` [GSoC][PATCH 4/6] t-reftable-pq: make merged_iter_pqueue_check() callable by reference Chandra Pratap
2024-06-06 11:48   ` Patrick Steinhardt
2024-06-06  7:40 ` [GSoC][PATCH 5/6] t-reftable-pq: add test for index based comparison Chandra Pratap
2024-06-06 11:48   ` Patrick Steinhardt
2024-06-06  7:40 ` [GSoC][PATCH 6/6] t-reftable-pq: add tests for merged_iter_pqueue_top() Chandra Pratap
2024-06-06 11:49   ` Patrick Steinhardt
2024-06-06 15:23 ` [GSoC][PATCH v2 0/6] t: port reftable/pq_test.c to the unit testing Chandra Pratap
2024-06-06 15:23   ` [GSoC][PATCH v2 1/6] reftable: clean up reftable/pq.c Chandra Pratap
2024-06-10  7:36     ` Patrick Steinhardt
2024-06-06 15:23   ` [GSoC][PATCH v2 2/6] t: move reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-06-06 15:23   ` [GSoC][PATCH v2 3/6] t-reftable-pq: make merged_iter_pqueue_check() static Chandra Pratap
2024-06-06 15:23   ` [GSoC][PATCH v2 4/6] t-reftable-pq: make merged_iter_pqueue_check() callable by reference Chandra Pratap
2024-06-06 15:23   ` [GSoC][PATCH v2 5/6] t-reftable-pq: add test for index based comparison Chandra Pratap
2024-06-06 15:23   ` [GSoC][PATCH v2 6/6] t-reftable-pq: add tests for merged_iter_pqueue_top() Chandra Pratap
2024-06-11  8:19   ` [GSoC][PATCH v3 0/7] t: port reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-06-11  8:19     ` [PATCH v3 1/7] reftable: remove unncessary curly braces in reftable/pq.c Chandra Pratap
2024-06-11  8:19     ` [PATCH v3 2/7] reftable: change the type of array indices to 'size_t' " Chandra Pratap
2024-06-11  9:02       ` Patrick Steinhardt
2024-06-11  8:19     ` [PATCH v3 3/7] t: move reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-06-11  8:19     ` [PATCH v3 4/7] t-reftable-pq: make merged_iter_pqueue_check() static Chandra Pratap
2024-06-11  8:19     ` [PATCH v3 5/7] t-reftable-pq: make merged_iter_pqueue_check() callable by reference Chandra Pratap
2024-06-11  8:19     ` [PATCH v3 6/7] t-reftable-pq: add test for index based comparison Chandra Pratap
2024-06-11  8:19     ` [PATCH v3 7/7] t-reftable-pq: add tests for merged_iter_pqueue_top() Chandra Pratap
2024-06-14  9:48     ` [GSoC][PATCH v4 0/7] t: port reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-06-14  9:48       ` [PATCH v4 1/7] reftable: remove unncessary curly braces in reftable/pq.c Chandra Pratap
2024-06-14  9:48       ` [PATCH v4 2/7] reftable: change the type of array indices to 'size_t' " Chandra Pratap
2024-06-14  9:48       ` [PATCH v4 3/7] t: move reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-06-14  9:48       ` [PATCH v4 4/7] t-reftable-pq: make merged_iter_pqueue_check() static Chandra Pratap
2024-06-14  9:48       ` [PATCH v4 5/7] t-reftable-pq: make merged_iter_pqueue_check() callable by reference Chandra Pratap
2024-06-14  9:48       ` [PATCH v4 6/7] t-reftable-pq: add test for index based comparison Chandra Pratap
2024-06-14  9:48       ` [PATCH v4 7/7] t-reftable-pq: add tests for merged_iter_pqueue_top() Chandra Pratap
2024-06-14 17:40       ` [GSoC][PATCH v4 0/7] t: port reftable/pq_test.c to the unit testing framework Junio C Hamano
2024-07-23 14:17       ` [GSoC][PATCH v5 " Chandra Pratap
2024-07-23 14:17         ` [PATCH v5 1/7] reftable: remove unncessary curly braces in reftable/pq.c Chandra Pratap
2024-07-23 14:17         ` [PATCH v5 2/7] reftable: change the type of array indices to 'size_t' " Chandra Pratap
2024-07-23 14:17         ` [PATCH v5 3/7] t: move reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-07-23 14:17         ` [PATCH v5 4/7] t-reftable-pq: make merged_iter_pqueue_check() static Chandra Pratap
2024-07-23 14:17         ` [PATCH v5 5/7] t-reftable-pq: make merged_iter_pqueue_check() callable by reference Chandra Pratap
2024-07-23 14:17         ` [PATCH v5 6/7] t-reftable-pq: add test for index based comparison Chandra Pratap
2024-07-24  9:03           ` Patrick Steinhardt
2024-07-24 16:15             ` Junio C Hamano
2024-07-25  5:10               ` Patrick Steinhardt
2024-07-23 14:17         ` [PATCH v5 7/7] t-reftable-pq: add tests for merged_iter_pqueue_top() Chandra Pratap
2024-07-23 17:09         ` [GSoC][PATCH v5 0/7] t: port reftable/pq_test.c to the unit testing framework Junio C Hamano
2024-07-24  5:12           ` Chandra Pratap
2024-07-24  7:17             ` Christian Couder
2024-07-24  7:51               ` Chandra Pratap
2024-07-24  8:56               ` Patrick Steinhardt [this message]
2024-07-24 16:06                 ` Junio C Hamano
2024-07-25  9:25         ` [GSoC][PATCH v6 " Chandra Pratap
2024-07-25  9:25           ` [PATCH v6 1/7] reftable: remove unncessary curly braces in reftable/pq.c Chandra Pratap
2024-07-25 13:29             ` Kristoffer Haugsbakk
2024-07-25  9:25           ` [PATCH v6 2/7] reftable: change the type of array indices to 'size_t' " Chandra Pratap
2024-07-25  9:25           ` [PATCH v6 3/7] t: move reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-07-25  9:25           ` [PATCH v6 4/7] t-reftable-pq: make merged_iter_pqueue_check() static Chandra Pratap
2024-07-25  9:25           ` [PATCH v6 5/7] t-reftable-pq: make merged_iter_pqueue_check() callable by reference Chandra Pratap
2024-07-25  9:25           ` [PATCH v6 6/7] t-reftable-pq: add test for index based comparison Chandra Pratap
2024-07-30  6:03             ` Patrick Steinhardt
2024-07-25  9:25           ` [PATCH v6 7/7] t-reftable-pq: add tests for merged_iter_pqueue_top() Chandra Pratap
2024-07-30  6:04             ` Patrick Steinhardt
2024-08-01 10:59           ` [GSoC][PATCH v7 0/7] t: port reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-08-01 10:59             ` [PATCH v7 1/7] reftable: remove unnecessary curly braces in reftable/pq.c Chandra Pratap
2024-08-01 10:59             ` [PATCH v7 2/7] reftable: change the type of array indices to 'size_t' " Chandra Pratap
2024-08-01 10:59             ` [PATCH v7 3/7] t: move reftable/pq_test.c to the unit testing framework Chandra Pratap
2024-08-01 10:59             ` [PATCH v7 4/7] t-reftable-pq: make merged_iter_pqueue_check() static Chandra Pratap
2024-08-01 10:59             ` [PATCH v7 5/7] t-reftable-pq: make merged_iter_pqueue_check() callable by reference Chandra Pratap
2024-08-01 10:59             ` [PATCH v7 6/7] t-reftable-pq: add test for index based comparison Chandra Pratap
2024-08-01 10:59             ` [PATCH v7 7/7] t-reftable-pq: add tests for merged_iter_pqueue_top() Chandra Pratap
2024-08-01 11:43             ` [GSoC][PATCH v7 0/7] t: port reftable/pq_test.c to the unit testing framework Patrick Steinhardt
2024-08-01 16:07               ` 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=ZqDBxUC34pV2TLGz@tanuki \
    --to=ps@pks.im \
    --cc=chandrapratap3519@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).