1. 23

  2. 6

    Thank you for the write-up!

    What is your take on using cgit over something more complex like gitea? . Last time I looked into it, one of the things that made cgit interesting was the option to serve a static website instead of hosting a gitea instance with the overhead that comes with it. Do you see any other benefits of cgit that maybe I haven’t considered?

    1. 6

      Can’t speak for the OP, but one argument for cgit is that you can point it at any bare git repo you like, whereas gitea is much more “managed” - there’s a database with all the repos it knows about and metadata and stuff. My usual workflow for “private-ish” git repos is approximately ssh my-shell-host "cd /home/git && git init --bare repo.git", so cgit fits quite nicely into that

      If anyone’s interested in the equivalent steps to get a barebones cgit running on nixos with nginx/fastcgi, I have a (hacky but reasonably well-commented) nixos module at https://gist.github.com/telent/b3cddb5b69d1206cb130bbff56b4d5e0 which you are welcome to.

      1. 2

        There are also less “managed” options in the static world, if I understand your intended meaning correctly. For example, stagit produces a static sequence of html pages, although it’s somewhat more geared towards smaller projects.

      2. 4

        What is your take on using cgit over something more complex like gitea?

        Well, as you imply, simplicity is one argument.

        And cgit shouldn’t be static, that’s could be stagit. cgit can generate miscelanious diffs, which would be horrible to implement statically.

        1. 3

          What is your take on using cgit over something more complex like gitea?

          cgit is lesser in all ways: hardware requirements, the amount of management, complexity; and that is what i like about it. For a personal instance, such as mine, I have no need for users, organizations, activity feeds, web notifications and the variety of other features provided by gitea.

        2. 5

          I am a little confused, as I self-host git with, well, git.

          As it comes out of the box with macOS, or at least once you install the dev-tools. I am assuming any other git install works the same, after all this is a DVCS.

          Anyway, having an http interface on top can be a nice-to-have, but calling this self-hosting seems a little misleading?

          1. 3

            Perhaps the title is better worded as “Self-hosted Git service with cgit”, but I understand what you mean, the core of self-hosting git is just git itself.

          2. 4

            If you care at all about big corporates turning open-source into a T-shirt farming service, this is the way to go.

            I feel this is a bit uncalled for. Yes, Hacktoberfest is a disaster. But DO did it to prompt open source. I can see why this would motivative someone to move away from GitHub, and I am keen to get rid of centralized dependencies too. But shouldn’t they actually blame the real bad actors here?

            “Big cooperations” is such an cheap target.

            1. 5

              But shouldn’t they actually blame the real bad actors here

              DO is to blame for making the rules so lax and not making it opt-in for projects. Nobody else. If you’re suggesting that a bunch of college freshman who don’t know better are the “bad actors”, I disagree.

            2. 3

              I like the ideas of using cgit, but I think it might be smidge too bare bones. I think if you want to offer your own programs’ source code to people then it behoves you to use some sort of index / interface.

              I moved my own repos over to using gitlist recently, but am feeling a few pain points.

              1. 2

                I think if you want to offer your own programs’ source code to people then it behoves you to use some sort of index / interface.

                Isn’t that what cgit is? With scan-path cgit will show an index of every repo under /var/git for instance, and then once you’re browsing a particular repo it offers pretty much every view you’d want, no?

              2. 3

                cgit combined with unix user account ssh based git repos is great. You can show anyone your code, but the real action is still on comandline git and ssh.

                (I was only using github as a code viewer)

                1. 2

                  Thinking about it, “send a patch via email” is not the only alternative to “send a pull request on github”. The simple alternative is Alice clones Bob’s repo, makes new commits, and self hosts her repo in public anywhere Bob can get it via https. Then Alice just emails Bob the URL and name of the branch she’s working on. This way nobody has to coerce their email client into working with plain text patches.

                  We could call it a “petition to retrieve” or something catchy like that.

                  1. 1

                    This is indeed probably a much simpler way to do it, and much more similar to a “pull request”!

                    But I fear the pull request is so convenient that it’s hard to convince people to start self-hosting :(

                    1. 1

                      Yes, I am describing the steps of a pull request on purpose. The stupid “petition to retrieve” bit was intended to be the punchline. ♥️

                    2. 1

                      Sure, that would work wonderfully. Github’s PR system is just an abstraction over this flow, forking (creating your own remote), adding changes, submitting a PR (sending an email with the name of the branch and the URL to your remote). The barrier to entry for this flow is the self hosting part, unfortunately, which is probably why patches are preferable.

                      1. 1

                        FWIW I was just being slightly tongue in cheek about the usability of email as a patch exchange mechanism as opposed to using the distributed vcs in a distributed manner.

                    3. 1

                      How are you planning to address repack(with bitmap index), garbage collection, commit-graph generations and backup?