# [RFC] cgit in git?

7 messages from 2008-12-11 to 2008-12-12. Participants: Lars Hjemli, Miklos Vajna, Jakub Narebski, Junio C Hamano, Johan Herland, Todd Zullinger.
Thread: https://gitlist.dev/t/16687

## Lars Hjemli, 2008-12-11 21:48

Subject: [RFC] cgit in git?
Message-ID: <8c5c35580812111348iceaf30dyb55183017cff5b1d@mail.gmail.com>
URL: https://gitlist.dev/e/8c5c35580812111348iceaf30dyb55183017cff5b1d%40mail.gmail.com

```
Background: I've been asked by the fedora project how to package cgit.
The problem is basically that cgit is designed to be statically linked
with a specific git release (i.e. libgit.a and xdiff/lib.a).

When manually building cgit from a tarball this isn't a problem:
'make get-git' will download the required git sources from kernel.org.
But the buildsystem/policy used by the fedora project does not allow
network access during package builds, and since it is quite unlikely
that the git package always will match the exact release needed by the
cgit package, I only see four options:
1) the fedora project makes a 'git-for-cgit' package containing the
needed release of the git sources
2) the cgit release tarballs includes the needed git sources
3) the cgit sources are subtree-merged into git
4) cgit is modified to link against libgit2

Option 1 seems unlikely to happen since such a 'git-for-cgit' package
would basically require the fedora project to support two git
packages.

Option 2 is doable but still requires the fedora project to support
two git packages (but now the 'git-for-cgit' package is hidden inside
the cgit source tree). The good thing about this option is that it
only requires some minor modifications to the cgit releases.

Option 3 would solve the problem for the fedora project but is not for
me to decide - it might become an extra maintenance burden on the git
maintainer and community.

Option 4 is the correct solution but not a very practical one; it's
currently hard to predict when libgit2 will be ready for general
(c)git use.

Personally I'd love for option 3 to happen, hence this rfc.

-- 
larsh

```

## Miklos Vajna, 2008-12-11 22:15

Subject: Re: [RFC] cgit in git?
Message-ID: <20081211221540.GA5691@genesis.frugalware.org>
URL: https://gitlist.dev/e/20081211221540.GA5691%40genesis.frugalware.org
In-Reply-To: <8c5c35580812111348iceaf30dyb55183017cff5b1d@mail.gmail.com>

```
On Thu, Dec 11, 2008 at 10:48:45PM +0100, Lars Hjemli <hjemli@gmail.com> wrote:
> 2) the cgit release tarballs includes the needed git sources
> 3) the cgit sources are subtree-merged into git
> 4) cgit is modified to link against libgit2
> 
> Option 1 seems unlikely to happen since such a 'git-for-cgit' package
> would basically require the fedora project to support two git
> packages.
> 
> Option 2 is doable but still requires the fedora project to support
> two git packages (but now the 'git-for-cgit' package is hidden inside
> the cgit source tree). The good thing about this option is that it
> only requires some minor modifications to the cgit releases.

I don't say 2) is the ideal solution (probably 4) will be), but that's
what we choosed for Frugalware and I think Fedora could live with it as
well.

```

## Jakub Narebski, 2008-12-11 22:28

Subject: Re: [RFC] cgit in git?
Message-ID: <m3k5a6gxft.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3k5a6gxft.fsf%40localhost.localdomain
In-Reply-To: <8c5c35580812111348iceaf30dyb55183017cff5b1d@mail.gmail.com>

```
"Lars Hjemli" <hjemli@gmail.com> writes:

> But the buildsystem/policy used by the fedora project does not allow
> network access during package builds, and since it is quite unlikely
> that the git package always will match the exact release needed by the
> cgit package, I only see four options:
> 1) the fedora project makes a 'git-for-cgit' package containing the
> needed release of the git sources
> 2) the cgit release tarballs includes the needed git sources

2b) make cgit .spec use _two_ tarballs as a source, one with cgit
sources, one with git sources.  This assumes that you always use
released git version as a base.

This is immediate solution.

> 3) the cgit sources are subtree-merged into git

I wonder how likely this would be.

> 4) cgit is modified to link against libgit2

Option 4) would be probably best in long term, but libgit2 doesn't
exists yet.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```

## Junio C Hamano, 2008-12-11 22:35

Subject: Re: [RFC] cgit in git?
Message-ID: <7vwse6bart.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vwse6bart.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <8c5c35580812111348iceaf30dyb55183017cff5b1d@mail.gmail.com>

```
"Lars Hjemli" <hjemli@gmail.com> writes:

> 2) the cgit release tarballs includes the needed git sources
>
> Option 2 is doable but still requires the fedora project to support
> two git packages (but now the 'git-for-cgit' package is hidden inside
> the cgit source tree). The good thing about this option is that it
> only requires some minor modifications to the cgit releases.

I do not understand why this is any extra work for fedora.  Instead of
running "make get-git" and then running your build procedure, they need to
just run your build procedure because you now ship your source with the
matching version of the git source, which sounds like the right thing to
me.  You do not install anything from the contained git.git area (we do
not do shared objects, nor public header files) to the end product, right?

Doesn't cgit bind git.git as a subproject at the source level?  I would
expect that the most natural release tarball for such a project would be a
single tarball that has both the superproject itself _and_ the submodules
it contains already extracted, iow, the state of your tree after you run
"make get-git".

```

## Johan Herland, 2008-12-11 22:40

Subject: Re: [RFC] cgit in git?
Message-ID: <200812112340.57223.johan@herland.net>
URL: https://gitlist.dev/e/200812112340.57223.johan%40herland.net
In-Reply-To: <8c5c35580812111348iceaf30dyb55183017cff5b1d@mail.gmail.com>

```
On Thursday 11 December 2008, Lars Hjemli wrote:
> Background: I've been asked by the fedora project how to package cgit.
> The problem is basically that cgit is designed to be statically linked
> with a specific git release (i.e. libgit.a and xdiff/lib.a).
>
> When manually building cgit from a tarball this isn't a problem:
> 'make get-git' will download the required git sources from kernel.org.
> But the buildsystem/policy used by the fedora project does not allow
> network access during package builds, and since it is quite unlikely
> that the git package always will match the exact release needed by the
> cgit package, I only see four options:
> 1) the fedora project makes a 'git-for-cgit' package containing the
> needed release of the git sources
> 2) the cgit release tarballs includes the needed git sources
> 3) the cgit sources are subtree-merged into git
> 4) cgit is modified to link against libgit2
>
> Option 1 seems unlikely to happen since such a 'git-for-cgit' package
> would basically require the fedora project to support two git
> packages.
>
> Option 2 is doable but still requires the fedora project to support
> two git packages (but now the 'git-for-cgit' package is hidden inside
> the cgit source tree). The good thing about this option is that it
> only requires some minor modifications to the cgit releases.
>
> Option 3 would solve the problem for the fedora project but is not for
> me to decide - it might become an extra maintenance burden on the git
> maintainer and community.
>
> Option 4 is the correct solution but not a very practical one; it's
> currently hard to predict when libgit2 will be ready for general
> (c)git use.
>
> Personally I'd love for option 3 to happen, hence this rfc.

Option 5: Include cgit as a submodule in git.git. Then it's available to 
those who want it, but not cloned/built by default.

If that doesn't pan out, I also support option #3.

I've been a happy cgit user for a number of months, and have yet to find a 
single issue where cgit is not better than or equal to gitweb. I have 
nothing bad to say about gitweb per se, but cgit simply offers me a better 
user experience, not least because of its blazing speed.


Have fun!

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

```

## Lars Hjemli, 2008-12-11 23:37

Subject: Re: [RFC] cgit in git?
Message-ID: <8c5c35580812111537v1144c9fdy19f2a3cc56e2a04f@mail.gmail.com>
URL: https://gitlist.dev/e/8c5c35580812111537v1144c9fdy19f2a3cc56e2a04f%40mail.gmail.com
In-Reply-To: <7vwse6bart.fsf@gitster.siamese.dyndns.org>

```
On Thu, Dec 11, 2008 at 23:35, Junio C Hamano <gitster@pobox.com> wrote:
> "Lars Hjemli" <hjemli@gmail.com> writes:
>
>> 2) the cgit release tarballs includes the needed git sources
>>
>> Option 2 is doable but still requires the fedora project to support
>> two git packages (but now the 'git-for-cgit' package is hidden inside
>> the cgit source tree). The good thing about this option is that it
>> only requires some minor modifications to the cgit releases.
>
> I do not understand why this is any extra work for fedora.

I imagined that it could have a ripple-effect on package dependencies,
i.e. the git release used by cgit could have subtle
'incompatibilities' with the real git package, but I really don't know
the first thing about packaging so this is just a guess.


> Instead of
> running "make get-git" and then running your build procedure, they need to
> just run your build procedure because you now ship your source with the
> matching version of the git source, which sounds like the right thing to
> me.  You do not install anything from the contained git.git area (we do
> not do shared objects, nor public header files) to the end product, right?

Right.


> Doesn't cgit bind git.git as a subproject at the source level?  I would
> expect that the most natural release tarball for such a project would be a
> single tarball that has both the superproject itself _and_ the submodules
> it contains already extracted, iow, the state of your tree after you run
> "make get-git".

Your expectation makes sense to me, thanks for elaborating.

Seth: would such a self-contained tarball solve the problems on your end?

--
larsh

```

## Todd Zullinger, 2008-12-12 00:15

Subject: Re: [RFC] cgit in git?
Message-ID: <20081212001546.GV13722@inocybe.teonanacatl.org>
URL: https://gitlist.dev/e/20081212001546.GV13722%40inocybe.teonanacatl.org
In-Reply-To: <8c5c35580812111537v1144c9fdy19f2a3cc56e2a04f@mail.gmail.com>

```
Lars Hjemli wrote:
> On Thu, Dec 11, 2008 at 23:35, Junio C Hamano <gitster@pobox.com>
> wrote:
>> Doesn't cgit bind git.git as a subproject at the source level?  I
>> would expect that the most natural release tarball for such a
>> project would be a single tarball that has both the superproject
>> itself _and_ the submodules it contains already extracted, iow, the
>> state of your tree after you run "make get-git".
>
> Your expectation makes sense to me, thanks for elaborating.
> 
> Seth: would such a self-contained tarball solve the problems on your
> end?

(I'm not Seth, nor do I play him on TV -- though I have been offered
his role in a small town production of "How the Grinch Stole
Christmas"... ;)

The downside to this is that cgit would be duplicating the git
sources, and thus, so would any distribution packages.  If there is a
bug in git, both the git and cgit packages would need to be updated to
fix it.

Basically, Fedora tries hard to use system libraries rather than
having applications include their own local copies.  (I recall some
zlib vulnerabilities years back that required way too many packages to
be rebuilt, since they each included their own copy of zlib.)

Obviously, since git is not intended to be used as a library, this
doesn't exactly match that situation.  But cgit is using git as a
library at the moment and if we could find a way to only have one copy
of the git sources to maintain, that'd be ideal from a distribution /
packaging perspective.  I do understand that it might not be as ideal
from either git or cgit developer / maintainer perspective, so the
consideration you're giving the issue is very much appreciated.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I never vote for anyone; I always vote against.
    -- W.C. Fields


```
