Hacker News new | past | comments | ask | show | jobs | submit login

> git push directly to the repository, in a separate branch namespace. This is how e.g. Gerrit works (pushing to a special ref makes a review, which is essentially the same as a pull request).

And that `git push` doesn't need to be literally to the one and only repository. The SSH daemon could create an isolated environment (e.g. QEMU, FreeBSD jail, etc) that contains a copy of the repository, and run the commands in there. Obviously this could also check SSH keys and the requested git commands before doing anything at all.

It would probably be like what Sourcehut does[1] for letting you SSH into build VMs, but instead of a build it's a push. And they already do some logic during a push[2], so their code for those two places is probably a good place to look for how to implement this kind of thing.

[1]: https://man.sr.ht/builds.sr.ht/build-ssh.md

[2]: https://sourcehut.org/blog/2019-11-22-what-happens-on-git-pu...




>And that `git push` doesn't need to be literally to the one and only repository

I believe github already has their own implementation of a git server, so any commands submitted to it are abstracted away. They probably don't have a literal .git directory sitting on a server.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: