From 7da176c0181f8cd68c5b75fe8cd7ffc5d2f8702d Mon Sep 17 00:00:00 2001 From: CypherpunkSamurai Date: Thu, 1 Sep 2022 21:14:02 +0000 Subject: [PATCH 1/6] Added docs for agit-setup --- docs/content/doc/usage/agit-support.en-us.md | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 docs/content/doc/usage/agit-support.en-us.md diff --git a/docs/content/doc/usage/agit-support.en-us.md b/docs/content/doc/usage/agit-support.en-us.md new file mode 100644 index 000000000000..09a3368042c1 --- /dev/null +++ b/docs/content/doc/usage/agit-support.en-us.md @@ -0,0 +1,57 @@ +--- +date: " 2022-09-01T20:50:42+0000" +title: "Usage: Agit Setup" +slug: "agit-setup" +weight: 12 +toc: false +draft: false +menu: + sidebar: + parent: "usage" + name: "Agit Setup" + weight: 12 + identifier: "agit-setup" +--- + +# Agit Setup + +In Gitea `1.13`, support for [agit](https://git-repo.info/en/2020/03/agit-flow-and-git-repo/) was added. + +## Creating PR with Agit +Agit allows creating a PR while pushing code to the remote repo. This requires using a speacial command refspec. + +- `HEAD` + + Target branch + +- `refs//` + + Target PR Type. + * `for` - Normal PR + * `draft` - Draft PR + * `for-review` - Generate a PR ID for updating existing PR. + +- `/` + + Target remote branch to open a PR. + +- `-o ` + + Options for the PR + * `title` - Title of the PR. + * `topic` - Topic of the PR. + * `description` - Description of the PR. (Contents in Markdown format) + +## Examples + +Example of pushing a repo with a PR: + +```shell +git push origin HEAD:refs/for/master +``` + +Example of pushing a repo with a PR `topic`, `title` and `description`: + +```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 markdown formatted.\n[x] Ok" +``` \ No newline at end of file From 8dfb61b592a6831fa7d63fd626ad31db0477b5ed Mon Sep 17 00:00:00 2001 From: CypherpunkSamurai Date: Fri, 2 Sep 2022 07:01:16 +0000 Subject: [PATCH 2/6] Fix Lint errors --- docs/content/doc/usage/agit-support.en-us.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/content/doc/usage/agit-support.en-us.md b/docs/content/doc/usage/agit-support.en-us.md index 09a3368042c1..beaa9f65a3bb 100644 --- a/docs/content/doc/usage/agit-support.en-us.md +++ b/docs/content/doc/usage/agit-support.en-us.md @@ -18,6 +18,7 @@ menu: In Gitea `1.13`, support for [agit](https://git-repo.info/en/2020/03/agit-flow-and-git-repo/) was added. ## Creating PR with Agit + Agit allows creating a PR while pushing code to the remote repo. This requires using a speacial command refspec. - `HEAD` @@ -27,9 +28,9 @@ Agit allows creating a PR while pushing code to the remote repo. This requires u - `refs//` Target PR Type. - * `for` - Normal PR - * `draft` - Draft PR - * `for-review` - Generate a PR ID for updating existing PR. + - `for` - Normal PR + - `draft` - Draft PR + - `for-review` - Generate a PR ID for updating existing PR. - `/` @@ -38,9 +39,9 @@ Agit allows creating a PR while pushing code to the remote repo. This requires u - `-o ` Options for the PR - * `title` - Title of the PR. - * `topic` - Topic of the PR. - * `description` - Description of the PR. (Contents in Markdown format) + - `title` - Title of the PR. + - `topic` - Topic of the PR. + - `description` - Description of the PR. (Contents in Markdown format) ## Examples @@ -54,4 +55,4 @@ Example of pushing a repo with a PR `topic`, `title` and `description`: ```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 markdown formatted.\n[x] Ok" -``` \ No newline at end of file +``` From 42d37e979fcee51f9f2b1d72571bae7e790874ec Mon Sep 17 00:00:00 2001 From: CypherpunkSamurai Date: Fri, 2 Sep 2022 12:55:48 +0000 Subject: [PATCH 3/6] Add suggested changes --- docs/content/doc/usage/agit-support.en-us.md | 47 +++++++------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/docs/content/doc/usage/agit-support.en-us.md b/docs/content/doc/usage/agit-support.en-us.md index beaa9f65a3bb..f8aba16445e3 100644 --- a/docs/content/doc/usage/agit-support.en-us.md +++ b/docs/content/doc/usage/agit-support.en-us.md @@ -17,42 +17,29 @@ menu: In Gitea `1.13`, support for [agit](https://git-repo.info/en/2020/03/agit-flow-and-git-repo/) was added. -## Creating PR with Agit +## Creating PRs with Agit -Agit allows creating a PR while pushing code to the remote repo. This requires using a speacial command refspec. - -- `HEAD` - - Target branch - -- `refs//` - - Target PR Type. - - `for` - Normal PR - - `draft` - Draft PR - - `for-review` - Generate a PR ID for updating existing PR. - -- `/` - - Target remote branch to open a PR. - -- `-o ` - - Options for the PR - - `title` - Title of the PR. - - `topic` - Topic of the PR. - - `description` - Description of the PR. (Contents in Markdown format) - -## Examples - -Example of pushing a repo with a PR: +Agit allows to create PRs while pushing code to the remote repo. \ +This can be done by pushing to the branch followed by a specific refspec (a location identifier known to git). \ +The following example illustrates this: ```shell git push origin HEAD:refs/for/master ``` -Example of pushing a repo with a PR `topic`, `title` and `description`: +The command has the following structure: + +- `HEAD`: The target branch +- `refs//`: The target PR type + - `for`: Create a normal PR with `` as the target branch +- `/`: The target branch to open the PR +- `-o `: Options for the PR + - `title`: The PR title + - `topic`: The PR topic + - `description`: The PR description (in Markdown format) + +Here's another advanced example for creating a new PR targeting `master` with `topic`, `title`, and `description`: ```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 markdown formatted.\n[x] Ok" +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" ``` From 841fe477a092285a8d2b230182c097392ddb1ab2 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 2 Sep 2022 22:18:39 +0200 Subject: [PATCH 4/6] Apply suggestions from code review Co-authored-by: delvh --- docs/content/doc/usage/agit-support.en-us.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/content/doc/usage/agit-support.en-us.md b/docs/content/doc/usage/agit-support.en-us.md index f8aba16445e3..080aa9fd1f68 100644 --- a/docs/content/doc/usage/agit-support.en-us.md +++ b/docs/content/doc/usage/agit-support.en-us.md @@ -30,13 +30,14 @@ git push origin HEAD:refs/for/master The command has the following structure: - `HEAD`: The target branch -- `refs//`: The target PR type +- `refs//`: The target PR type - `for`: Create a normal PR with `` as the target branch + - `draft`/ `for-review`: Currently ignored silently - `/`: The target branch to open the PR - `-o `: Options for the PR - `title`: The PR title - - `topic`: The PR topic - - `description`: The PR description (in Markdown format) + - `topic`: The branch name the PR should be opened for + - `description`: The PR description Here's another advanced example for creating a new PR targeting `master` with `topic`, `title`, and `description`: From 7c9edad8a0dbb7f05042b3f94abb6657cc724639 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 3 Sep 2022 13:30:13 +0200 Subject: [PATCH 5/6] Update docs/content/doc/usage/agit-support.en-us.md Co-authored-by: a1012112796 <1012112796@qq.com> --- docs/content/doc/usage/agit-support.en-us.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/doc/usage/agit-support.en-us.md b/docs/content/doc/usage/agit-support.en-us.md index 080aa9fd1f68..a6de28eec39c 100644 --- a/docs/content/doc/usage/agit-support.en-us.md +++ b/docs/content/doc/usage/agit-support.en-us.md @@ -38,6 +38,7 @@ The command has the following structure: - `title`: The PR title - `topic`: The branch name the PR should be opened for - `description`: The PR description + - `force-push`: confirm force update the target branch Here's another advanced example for creating a new PR targeting `master` with `topic`, `title`, and `description`: From c103e884a1bcbb7a54bad8ce3e8aed1bac11f826 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 3 Sep 2022 18:33:00 +0200 Subject: [PATCH 6/6] fix lint --- docs/content/doc/usage/agit-support.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/doc/usage/agit-support.en-us.md b/docs/content/doc/usage/agit-support.en-us.md index a6de28eec39c..c71be6837064 100644 --- a/docs/content/doc/usage/agit-support.en-us.md +++ b/docs/content/doc/usage/agit-support.en-us.md @@ -36,7 +36,7 @@ The command has the following structure: - `/`: The target branch to open the PR - `-o `: Options for the PR - `title`: The PR title - - `topic`: The branch name the PR should be opened for + - `topic`: The branch name the PR should be opened for - `description`: The PR description - `force-push`: confirm force update the target branch