From 5ad6a4127e2241aafd48f1f3efb292ae7462cc8a Mon Sep 17 00:00:00 2001 From: Sienna Lloyd Date: Mon, 11 Sep 2023 02:50:55 -0700 Subject: [PATCH] Updated agit doc for git-repo Added basic reference instructions to unblock `git-repo` users who don't use Gerrit but use Gitea. --- docs/content/usage/agit-support.en-us.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/content/usage/agit-support.en-us.md b/docs/content/usage/agit-support.en-us.md index b1643d27b3ef7..6ecdd88051c03 100644 --- a/docs/content/usage/agit-support.en-us.md +++ b/docs/content/usage/agit-support.en-us.md @@ -47,3 +47,26 @@ Here's another advanced example for creating a new PR targeting `master` with `t ```shell git push origin HEAD:refs/for/master -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok" ``` + +## Using `git-repo` + +If you want to use [`git-repo`](https://git-repo.info/) for your agit workflow, either in single- or multi-repo mode, you need to take a few steps. + +1. Create a file in `$GITEA_CUSTOM/public/` called `ssh_info` +2. Populate it with `{"type":"agit","version":2}` +3. Add a rewrite rule for your reverse proxy which rewrites the request path equaling `/ssh_info` to `/assets/ssh_info` +4. Restart Gitea +5. Within a project in your `git-repo` workspace, run `git pr -vv` + +If the reverse proxy rewrite has been implemented correctly, you should see something like this: + +```sh +$ git pr -vv +DEBUG: get ssh_info from API: https://$ROOT_URL/ssh_info +DEBUG: fail to get proxy from git config: http.proxy is not set +DEBUG: query ssh_info successfully: &helper.SSHInfo{PushURL:"", Host:"", Port:0, User:"", ProtoType:"agit", ProtoVersion:2, ReviewRefPattern:"", Expire:0} +DEBUG: save cache file '~/workspace/.repo/projects/manifest.git/info/sshinfo.cache', expire at '2023-09-11 14:48:11', data: '{"type":"agit","version":2}' +NOTE: no branches ready for upload +``` + +`git-repo` has been correctly configured for Gitea.