Kallithea – Self-hosted alternative to GitHub
kallithea-scm.org
kallithea-scm.org
I'm pretty happy now, with one system less to manage (although I don't want to discourage anyone to have a look at Kallithea - maybe it suits your needs!)
Aha, '--bare': what does that do? I always just type 'git init'.
Let me do a little git bashing, OK? Sorry for this, but it so nicely documents my initial problems with git when I started a few years back. And it still occasionally (like right now) makes me shake my head in disbelief:
> man git-init
Searching for --bare gives me:
> --bare
> Create a bare repository. ...and how GIT_DIR is set...
You don't say!!
I search for other occurrences of 'bare' in that man page, but after skipping those in the synopsis and the help text, it says:
> Pattern not found
So bare = bare. Tautological documentation. It's all obvious, right?
What --bare really does is to put what git would normally put into the '.git' subdir into '.'. I tried what it does, that's how I found out.
Git is great, but please never claim that it is intuitively documented.
That said I concur and don’t think anyone would make such a claim about git documentation.
If all else fails, try https://git-man-page-generator.lokaltog.net/ :)
A bare repo has only Git's own data structure files. It's basically the contents of a non-bare repo's ".git/" directory, without a checked out working copy of all the files that are contained in the repo. The files are all still there but stored inside Git's database and not in the filesystem in the normal way.
The advantage: you can push commits to a bare repo. It's the kind of repo you'd put on your remote dev server. If you try to push to a non-bare repo, you'd get an error message like:
remote: error: refusing to update checked out branch: refs/heads/dev
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
...which is a long way of saying "don't do that". The disadvantage is that you can't cd into a bare repo and use "ls" and friends to browse around.So here's the even shorter answer:
Make a bare repo when you only want to push to it but not work inside it, say because you're making a shared repo for you and your friends to work on together.
Make a non-bare repo when you want to work inside it but not push to it, say because it's a project you're developing on your laptop.
A bare git repo is a server side git repo while non-bare is client side.
Git has an extremely complex data structure/state: It's a forest of DAGs (commits in distributed repos), with labels on them (branches), that have specified relationships (remotes), as well as an index and a stash per DAG. All of this on top of the working directory (and .gitignore if you want).
Of course these individual elements are mostly necessary to enable complex workflows. But simple workflows interact with all of these elements too in complex ways. This complexity is neither hidden behind a sensible set of UX abstractions, nor are they cleanly exposed to the user with a set of clean elementary operations to work on them...
The main difference, I think, is that mercurial has stronger opinions on how you should manage your repository and hides everything that doesn't fit its views behind extensions.
Really, I don't understand how git managed to become so popular. It is really good and I like it a lot but it really takes time getting used to. I screwed up a lot before getting competent with it, and I still screw up from time to time. It didn't happen with cvs, svn and mercurial.
It makes me think of Perl. Powerful and messy, I like if for the same reason I like git. But while Perl is on the way down, progressively replaced by cleaner, more opinionated alternatives, git is becoming a de-facto standard.
In addition to that, I suspect it was the very fact that Mercurial had more features, specifically an in built web server that allowed you to easily share your repo, led to GitHub being created with git and not mercurial.
The way I look at it, Mercurial made it extremely easy to self host a repo. So there was no need for a 3rd party centralized service to share your mercurial repo. That wasn’t the case for git, so something like GitHub was needed.
But the centralization in GitHub also allowed them to add more social features, which allowed git to spread more widely.
> GIT_DIR
> If the GIT_DIR environment variable is set then it specifies a path to use instead of the default .git for the base of the repository. The --git-dir command-line option also sets this value.
That said, manuals are typically written like this, meaning that for terms one isn't already aware of, there is a need to search through the index to find its meaning and them piece together the information.
I'm confused on what you find confusing here?
Ok, so can you tell me what is a tiramisu repository?
Googling for the definition I find "Bare: without addition; basic and simple."
And yes, I can. A tiramisu repository is a fictional repository that is not at all mentioned the very helpful help section of git init. While completely fabricated, the tiramisu repository is one of the best tasting repositories git can produce.
You could try
> man -K "bare repo"
to search all man pages for that string, and you'll find that
> man git-clone
has the information you are looking for:
"--bare: Make a bare Git repository. That is, instead of creating <directory> and placing the administrative files in <directory>/.git, make the <directory> itself the $GIT_DIR. This obviously implies the -n because there is nowhere to check out the working tree."
If you have Internet connectivity, Google is also an option. Among the first hits should be the book "Pro Git", chapter "4.2 Git on the Server", which begins with a concise explanation what a bare repository is.
Well, yes, that's one of the problems. I am saying the docs are unintuitive, and now you are confirming that.
For 'git init --bare', I look into 'git-init' and search for '--bare'. That's what I do, that's intuitive to me. And that's not where the info is. Is all I am saying.
I've got a personal instance running on openSUSE in a tiny 1 vCPU+1GB RAM VPS, and it works really well. It's fairly lightweight on resources, too (my VPS instance rarely sees significant load).
[2]: https://src.fedoraproject.org/rpms/pagure
[3]: https://build.opensuse.org/package/show/openSUSE:Factory/pag...
I didn't know that mercurial had a web interface, I'll certainly take a look this week.
git add --patch [FILE...]
btw (by invoking your $EDITOR).We too just switched to bare repos and haven't really missed much from the SCM frontends.
That's the one example I'm referring to.
Since then, we faced a number of UI bugs that we just didn't bother to report since most other attempts at reaching out were rejected as "not our problem".
- https://github.com/go-gitea/gitea/pull/15268
- https://github.com/go-gitea/gitea/pull/14726
- https://github.com/go-gitea/gitea/pull/15315
- https://github.com/go-gitea/gitea/issues/14639
We're a volunteer team, so any information you can add to an issue would be greatly appreciated. Even if you're not using Gitea anymore.
Does this extend also to the case of when someone submits a pull request to them, or only for issues that people file?
If the former then it is truly problematic. If the latter they may be simply overworked/overburdened by the volume of issues that are being filed, and could need more people submitting pull requests instead of opening issues.
Although merging and reviewing a pull request can also be quite time-consuming. If you are already overworked, it might add to the problem. I'm happy that none of my open-source projects went through the roof. I won't be able to manage it alone.
The maintainer has responded more recently than the GP's last comment. "ignore" feels like a stretch.
Please stop assuming malice in others. You'll be a happier person.
I've responded to the dev, FWIW.
But for bigger projects I now use github as I missed CI and pull request review flows, even for my own work
A bit off topic - but is that an underlying problem with go-lang projects? I've seen a similar problem when using a couple of other go-lang tools, where the entire CPU hits 100% and locks the machine. Too many channels/threads perhaps?
It doesn't. And it shouldn't.
I don't need code browsing on my SMB repo because, well, I'm the only one working on it. And even if I weren't, it'd be kinda fine anyways. I don't have the extra layer of security, but I don't need that either: I already need credentials to connect to my SMB share.
PRs - well, single project. It's just for me, so merging my own feature branches seems fine.
Issues are indeed an "issue". I simply track them in a markdown file. Whatever floats your boat should be fine, though. Combined, for me personally, it works better than managing a platform I don't really need.
What's that good for?
..which is unfortunate.
stable: https://kallithea-scm.org/repos/kallithea/files/7f3515800bd8...
PR: https://kallithea-scm.org/repos/kallithea/pull-request -> https://kallithea-scm.org/repos/kallithea/pull-request/140/_...
(...which you can delete everything after /140/ and it works fine). Oy vey.
This is good pattern but not implemented correctly. It should rewrite to full correct url. It can be abuse like this:
/140/_/ThisProjectSucksDontUseIt-UseThisOneXXXXXX
https://kallithea-scm.org/repos/kallithea/pull-request/140/_...
Query strings and hashes are a little different, since those may contain information you might not want to scrub.
"Vanity" paths in particular can be rewritten because you often have a "correct" value for a given route.
e.g. https://community.nodebb.org/topic/180/who-is-using-nodebb
You can rewrite the tail end of this URL to whatever you'd like but it will always redirect you back to the correct canonical slug.
I suppose if you're a small group of people that don't need github's main feature (other people) and just want a local github-alike for playing it's cool. But why not just git then?
Is it? I would have said it was a collaborative tool. I don't use it to 'socialise' and 'chat' with other users. I use it to thrash out PRs.
But I do agree with the gist of what you're saying.
Yes indeed social network like Facebook, which can stop access to repository or code based on DMCA. It pose many serious risks, given a lot of open source code is under control of a single corporate entity.
Hopefully social model evolves and become fully distributed which is the fundamental basis of git/hg/fossil and other distributed version control.
Today all the necessary technology is available, needs an effort to integrate them and bring back the self-hosted alternative which automatically forms a distributed social network to collaborate on code.
I know about gitlab et al, but nothing really quite creeps up to the same level of GitHub
Personally I would be much too cool to actually socialize on GitHub.
Separate script can restore from backup. All in all seems pretty safe to me. Obviously it does not scale to Github proportions.
Sounds too much ado for nothing compared to use free private repos on GitHub / GitLab.
Maintenance wise it is easy. In any way I am not letting other company to be in control of my infrastructure and data.
B. self-hosted server + self-maintained offsite backup
A is obviously easier than B. And also A has tons of other benefits.
The thing is, the killer feature for me is gitlab-ci (and private repositories). Using gitlab-ci along with my own runners (tied to a private group) along with git-crypt I should be able to do most things that I do in my small gitlab instance.
The thing is, alternatives are maybe lighter, but they don't pack as many features as gitlab and lack some kind of integrated-everywhere CI.
Leaving git, I'm not even considering that.
I'd love an excuse to leave Jenkins for self-hosted multi-platform jobs, but nothing else seems to have the flexibility and to project confidence that it'll still be around and well-maintained in, say, five years.
I really don't feel the need for anything besides gitlab + gitlab-ci.
Not sure of others but in the early years we chose mercurial over git due to to its beautiful command line UI, conceptual integrity and easier mental model. Even today hg is easier to pick up for new developers in our startup compared to git, even though git has bigger mindshare due to GitHub.
In hg specially like the default setting for immutable commit history and explicit merges unless forcibly overridden.
hg had a way better developer interface and I miss it for that but all the tooling and integrations supported git.
With Git permeating every enterprise and organisation I've contracted for in the past years, I'm surprised to see Mercurial support hailed as a win.
Also like the default in mercurial repository for immutable commit history and explicit merges unless forcibly overridden.
So still today use mercurial in our startup and if need to use git, we keep a mirror of git repository in our kallithea instance. We integrate git in our internal workflow using hg-git.
This is, as far as I can tell from my memory, ahistorical. While git was still young in 2008, it was already quite dominant.
The Linux's choice was hugely influential, and Linus' "angry and confident" style of advocacy has always been (regretfully) effective when used against software people. Git stole the mind share _very_ quickly, and by the time Github became a thing I remember almost everyone _wanting_ to be on Git. Hg and Bazaar were clear contrarians, even if I personally might have liked Hg.
I'm fairly sure that Github is "Git"hub due to Git's popularity, not the other way around.
Linus' marketing is a footnote compared to git's main feature for commercial software vendors: it's abysmal design flaws and utterly obtuse UI. That makes it incredibly easy to earn money by tacking on stuff that makes that abomination actually usable. I'd wager that github's success is built on that.
So why isn't "pull request" a good name for a request to pull from a different repo?
However, the diff view appears wrapped on a mobile screen [1]. I'd prefer a scrolled diff, that is viewport fitting the screen, but the contents not wrapped. This would allow one to see long lines of code as is, instead of stacked in pieces.
Another wish is side-by-side diff view.
[1]: https://kallithea-scm.org/repos/kallithea/changeset/e6034764...
I am less sure about when Gerrit was created, but it is possibly older.
Gitea isn't as full-featured as Gitlab, but it's so much easier to manage.
Can anyone recommend a self-hosted alternative to Jira?
I'm not sure why it is such a well kept secret.
Thanks, will check it out :-)
I'd like to reuse an existing api, for example Kallithea or Gitlab layer/api that interacts with git, does anyone have opinions which one would be easier to reuse?
I fail to find documentation from Gitlab on how services are organised, if they have a git api as a separate process and how to run just that.
Now I'm discovering Kallithea, I'll have a look to it, but really appreciate if someone has done this before and has some pointers where to start.
On that page you'll find a link to docs for Gitaly, a Git RPC service that handles all Git calls made by GitLab.
But if you had taken time to read the first sentence on the link, you would see that there is in fact a key difference:
> Kallithea [...] is [...] source code management system that supports two leading version control systems, Mercurial and Git
This is something that alternatives do not do [1] [2] [3] [4]. There are likely further differences if you read the documentation at https://kallithea.readthedocs.io/en/latest/readme.html
[1] https://github.com/go-gitea/gitea/issues/458 [2] https://github.com/gogs/gogs/issues/125 [3] https://gitlab.com/gitlab-com/blog-posts/-/issues/261 [4] https://www.gerritcodereview.com/roadmap.html
When rhodecode went closed source, Kallithea was forked, and has been maintained ever since.
do you or do you just give grumpy advice how others should spend their own time?
Maybe the author just wanted to build something to practice code or to do something different than GitHub.
Innovation (and evolution) happen via mutation - it’s wrong to ask people to conform to set standards in a forum dedicated to interesting bits of knowledge.