git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: none

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 20, 2019, 04:52 UTC
Message-ID
<xmqqsgmjb13r.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAFQ2z_OMr4J-gF1HXXkSQFheiDkf+7WBbn-oLYeDydmuLSfN1w@mail.gmail.com>
Han-Wen Nienhuys <hanwen@google.com> writes:
Show 9 quoted lines
> I spent the last few weeks cobbling together an implementation of the
> reftable format in C and in Go. I thought this would be cool to add to
> git-core, but I doubt whether I will have enough time to see such an
> effort through. Maybe some of you would want to try integrating it
> into the Git-core code base?  Example code is here:
>
>   https://github.com/google/reftable/blob/master/c/api.h#L153
>
> cheers!

My initial impression was that the API overuses typedef. We tend to avoid doing

	struct _foo { ... };
	typedef struct _foo foo;

and instead write "struct foo" explicitly to make us well aware of what we are talking about. That lets us see that we are passing or returning a structure by value (which we would like authors to think thrice before doing in C) like so quite easily:

	foo some_function(foo arg1, ...) { ... }
because it would be clear if it were written like so
	struct foo some_function(struct foo arg1, ...) { ... }

without hiding the structure behind a typedef (it also lets us avoid names with leading underscore, which is frowned upon by some people for different reasons).

But the set of operations defined in the header file seemed at the right granularity in order to interface with the refs.h & refs/* API we have. It however was unclear to me how transactional ref updates would work with it.

Thanks.
Previous: Han-Wen NienhuysNext: Han-Wen Nienhuys
Message 2 of 6 in “”
  1. Han-Wen NienhuysNov 20, 2019
  2. Junio C HamanoNov 20, 2019
  3. Han-Wen NienhuysNov 20, 2019
  4. reftable (was: Re: none)Han-Wen Nienhuys, Nov 22, 2019
  5. Taylor BlauNov 20, 2019
  6. Christian CouderNov 20, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.