Hi Han-Wen, On Sat, 10 Oct 2020, Han-Wen Nienhuys wrote: > On Thu, Oct 8, 2020 at 3:48 AM Jonathan Tan <jonathantanmy@xxxxxxxxxx> wrote: > > > > > From: Han-Wen Nienhuys <hanwen@xxxxxxxxxx> > > > > > > This commit provides basic utility classes for the reftable library. > > > > > > Since the reftable library must compile standalone, there may be some overlap > > > with git-core utility functions. > > > I think duplicating things like strbuf is an unnecessary burden if Git > > is to maintain this library. Something like "reftable will only import > > git-compat-util.h and strbuf.h, and any project that wants to use > > reftable must make sure that these functions and data structures are > > available" would be more plausible. > > Sure, but how do we ensure that the directory won't take on > dependencies beyond these headers? I am worried that I will be > involved in a tedious back & forth process to keep updates going into > libgit2 and/or also have to keep maintaining > github.com/google/reftable. > > FWIW, the duplication is really tiny: according to > > $ wc $(grep -l REFTABLE_STANDALONE *[ch]) > > it's just 431 lines of code. The `merge_bases_many()` function has only 33 lines of code, partially duplicating `get_reachable_subset()`. Yet, it had a bug in it for two years that was not found. How much worse will the situation be with your 431 lines of code. Even more so when you consider the fact that you intend to shove the same duplication down libgit2's throat. It's "triplicating" code. So I find the argument you made above quite unconvincing. Ciao, Dscho