This PR adds Gist support to Forgejo. Gists are small Git Repos. They are used to share Codesnipets.
Implementation:
- Each Gist has it's own random UUID (e.g.
7f4d4b2b). They can be accessed using the/gists/{gistuuid}route. - You can have multiple Gists with the same Name (e.g. Log)
- Gist Repos can't contain binary files
- Gist Repos can't contain directories
- Gist are only allowed to have a
mainbranch. - Gist can only have a Owner, which has write permission. There is no way to give others Permissions like with Repos.
- Gist don't have Issues or Pull Requests (Comments might be added in a follow up PR)
- A Gist has one of 3 visibility levels:
- Public: The Gist can be seen be anyone
- Hidden: The Gist can be seen by anyone but does not appear in the Search
- Private: The Gist can only be seen be the Owner
- Gists are saved in a diffrent directory than normal Repos
- Gists are saved independently to Repos in the Database
Screenshots:
Why W.I.P.
- This PR is currently missing tests
- Some Bugs are still there
- Some polish is needed
The Feature itself is fully finished and can be reviewed.
Implements #1069
Checklist
The contributor guide contains information that will be helpful to first time contributors. There also are a few conditions for merging Pull Requests in Forgejo repositories. You are also welcome to join the Forgejo development chatroom.
Tests
- I added test coverage for Go changes...
- in their respective
*_test.gofor unit tests. - in the
tests/integrationdirectory if it involves interactions with a live Forgejo server.
- in their respective
- I added test coverage for JavaScript changes...
- in
web_src/js/*.test.jsif it can be unit tested. - in
tests/e2e/*.test.e2e.jsif it requires interactions with a live Forgejo server (see also the developer guide for JavaScript testing).
- in
Documentation
- I created a pull request to the documentation to explain to Forgejo users how to use this change.
- I did not document these changes and I do not expect someone else to do it.
Release notes
- I do not want this change to show in the release notes.
- I want the title to show in the release notes with a link to this pull request.
- I want the content of the
release-notes/<pull request number>.mdto be be used for the release notes instead of the title.