{"thread":{"id":"52297","subject":"Re: none","startedAt":"2019-11-20T03:49:34Z","lastAt":"2019-11-22T11:24:38Z","messageCount":6,"participants":["Junio C Hamano","Han-Wen Nienhuys","Taylor Blau","Christian Couder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"387013","messageId":"CAFQ2z_OMr4J-gF1HXXkSQFheiDkf+7WBbn-oLYeDydmuLSfN1w@mail.gmail.com","threadId":"52297","inReplyTo":null,"subject":"","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2019-11-20T03:49:17Z","receivedAt":"2019-11-20T03:49:34Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Hey folks,\n\nI spent the last few weeks cobbling together an implementation of the\nreftable format in C and in Go. I thought this would be cool to add to\ngit-core, but I doubt whether I will have enough time to see such an\neffort through. Maybe some of you would want to try integrating it\ninto the Git-core code base?  Example code is here:\n\n  https://github.com/google/reftable/blob/master/c/api.h#L153\n\ncheers!\n--\nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\nRegistergericht und -nummer: Hamburg, HRB 86891\nSitz der Gesellschaft: Hamburg\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"386613","messageId":"xmqqsgmjb13r.fsf@gitster-ct.c.googlers.com","threadId":"52297","inReplyTo":"CAFQ2z_OMr4J-gF1HXXkSQFheiDkf+7WBbn-oLYeDydmuLSfN1w@mail.gmail.com","subject":"Re: none","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-11-20T04:52:56Z","receivedAt":"2019-11-20T04:53:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Han-Wen Nienhuys <hanwen@google.com> writes:\n\n> I spent the last few weeks cobbling together an implementation of the\n> reftable format in C and in Go. I thought this would be cool to add to\n> git-core, but I doubt whether I will have enough time to see such an\n> effort through. Maybe some of you would want to try integrating it\n> into the Git-core code base?  Example code is here:\n>\n>   https://github.com/google/reftable/blob/master/c/api.h#L153\n>\n> cheers!\n\nMy initial impression was that the API overuses typedef.  We tend to\navoid doing\n\n\tstruct _foo { ... };\n\ttypedef struct _foo foo;\n\nand instead write \"struct foo\" explicitly to make us well aware of\nwhat we are talking about.  That lets us see that we are passing or\nreturning a structure by value (which we would like authors to think\nthrice before doing in C) like so quite easily:\n\n\tfoo some_function(foo arg1, ...) { ... }\n\nbecause it would be clear if it were written like so\n\n\tstruct foo some_function(struct foo arg1, ...) { ... }\n\nwithout hiding the structure behind a typedef (it also lets us avoid\nnames with leading underscore, which is frowned upon by some people\nfor different reasons).\n\nBut the set of operations defined in the header file seemed at the\nright granularity in order to interface with the refs.h & refs/* API\nwe have.  It however was unclear to me how transactional ref updates\nwould work with it.\n\nThanks.\n"},{"id":"386614","messageId":"CAFQ2z_N611Y+3TXWLsOKjL=muk3XON11gaS1qyGxZUWp8Leqag@mail.gmail.com","threadId":"52297","inReplyTo":"xmqqsgmjb13r.fsf@gitster-ct.c.googlers.com","subject":"Re: none","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2019-11-20T05:00:54Z","receivedAt":"2019-11-20T05:01:08Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Tue, Nov 19, 2019 at 8:53 PM Junio C Hamano <gitster@pobox.com> wrote:\n> My initial impression was that the API overuses typedef.  We tend to\n> avoid doing\n>\n>         struct _foo { ... };\n>         typedef struct _foo foo;\n>\n> and instead write \"struct foo\" explicitly to make us well aware of\n> what we are talking about.\n\nThanks, i'll have a look at changing it. I use typedef mainly for\nergonomics, but now that the code is written, I can introduce more\nverbosity.\n\n> But the set of operations defined in the header file seemed at the\n> right granularity in order to interface with the refs.h & refs/* API\n> we have.  It however was unclear to me how transactional ref updates\n> would work with it.\n\nTransactions have to interface with the file system. I imagine that\ndifferent libraries (libgit vs. cgit) would have different primitives\nfor dealing with the file system, hence I haven't implemented that\npart. Do you have an idea of how I could implement it in a way that is\nagnostic of libgit2 vs. cgit?\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"386615","messageId":"20191120053011.GA41291@syl.local","threadId":"52297","inReplyTo":"CAFQ2z_OMr4J-gF1HXXkSQFheiDkf+7WBbn-oLYeDydmuLSfN1w@mail.gmail.com","subject":"Re: your mail","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2019-11-20T05:30:11Z","receivedAt":"2019-11-20T05:30:17Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"Hi Han-Wen,\n\n\nOn Tue, Nov 19, 2019 at 07:49:17PM -0800, Han-Wen Nienhuys wrote:\n> Hey folks,\n>\n> I spent the last few weeks cobbling together an implementation of the\n> reftable format in C and in Go. I thought this would be cool to add to\n> git-core, but I doubt whether I will have enough time to see such an\n> effort through. Maybe some of you would want to try integrating it\n> into the Git-core code base?  Example code is here:\n>\n>   https://github.com/google/reftable/blob/master/c/api.h#L153\n\nVery exciting, and thanks for your work on this. I haven't taken a\nclose look at the code yet, so I'm sure taking this further involves a\nmuch more careful examination.\n\nI know that Christian Couder (who you CC-d on this thread) was also\nworking on this for either GitLab or Booking.com.\n\nChristian -- are you still working on this for either one of those\nentities? If so, is there some way to unify these two efforts?\n\n> cheers!\n> --\n\nThanks,\nTaylor\n"},{"id":"386619","messageId":"CAP8UFD27ReXZ_pA3v6iwHebNBfwxuEKy4dAhPyTu0Ey=TzvCkA@mail.gmail.com","threadId":"52297","inReplyTo":"20191120053011.GA41291@syl.local","subject":"Re: your mail","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2019-11-20T08:05:54Z","receivedAt":"2019-11-20T08:06:09Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi Taylor and Han-Wen,\n\nOn Wed, Nov 20, 2019 at 6:30 AM Taylor Blau <me@ttaylorr.com> wrote:\n>\n> On Tue, Nov 19, 2019 at 07:49:17PM -0800, Han-Wen Nienhuys wrote:\n> >\n> > I spent the last few weeks cobbling together an implementation of the\n> > reftable format in C and in Go. I thought this would be cool to add to\n> > git-core, but I doubt whether I will have enough time to see such an\n> > effort through. Maybe some of you would want to try integrating it\n> > into the Git-core code base?  Example code is here:\n> >\n> >   https://github.com/google/reftable/blob/master/c/api.h#L153\n\nInteresting!\n\n> Very exciting, and thanks for your work on this. I haven't taken a\n> close look at the code yet, so I'm sure taking this further involves a\n> much more careful examination.\n>\n> I know that Christian Couder (who you CC-d on this thread) was also\n> working on this for either GitLab or Booking.com.\n>\n> Christian -- are you still working on this for either one of those\n> entities? If so, is there some way to unify these two efforts?\n\nYeah, I started working on this last year for Booking.com, and I am\nnow slowly working on it for GitLab. It is not yet finished because it\nhas been low priority work.\n\nI took a very quick look at Han-Wen's implementation and it looks very\ndifferent from mine from the outside. It seems more complete, but\nmight be less integrated into the Git code base.\n\nBest,\nChristian.\n"},{"id":"386815","messageId":"CAFQ2z_PbPEH3=9uJHqXdjV+pxF_-NSS2PGY1ZU-JtxRAuxN66g@mail.gmail.com","threadId":"52297","inReplyTo":"xmqqsgmjb13r.fsf@gitster-ct.c.googlers.com","subject":"reftable (was: Re: none)","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2019-11-22T10:38:25Z","receivedAt":"2019-11-22T11:24:38Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Tue, Nov 19, 2019 at 8:53 PM Junio C Hamano <gitster@pobox.com> wrote:\n> > I spent the last few weeks cobbling together an implementation of the\n> > reftable format in C and in Go. I thought this would be cool to add to\n> > git-core, but I doubt whether I will have enough time to see such an\n> > effort through. Maybe some of you would want to try integrating it\n> > into the Git-core code base?  Example code is here:\n> >\n> >   https://github.com/google/reftable/blob/master/c/api.h#L153\n> >\n> > cheers!\n>\n> My initial impression was that the API overuses typedef.\n\nI changed the code to use struct throughout.\n\n> But the set of operations defined in the header file seemed at the\n> right granularity in order to interface with the refs.h & refs/* API\n> we have.  It however was unclear to me how transactional ref updates\n> would work with it.\n\nI implemented the reftable stack in Go, see\n\n  https://godoc.org/github.com/google/reftable#Stack\n\nwhich I could implement in C too. Would that work?\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n"}]}